Skip to content

Commit f3562dc

Browse files
committed
completely re-implemented guided tours in typescript
1 parent ef17345 commit f3562dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4215
-4611
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
{
66
"modules": false
77
}
8-
]
8+
],
9+
"@babel/preset-typescript"
910
],
1011
"plugins": []
1112
}

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tourguidejs",
33
"version": "2.0.0",
4-
"src": "src/Tour.js",
4+
"src": "src/Tour.ts",
55
"main": "tourguide.js",
66
"module": "tourguide.esm.js",
77
"description": "Guided tour feature plugin for docsie manager",
@@ -34,12 +34,16 @@
3434
"npm": ">=3.0.0",
3535
"node": ">=6.0.0"
3636
},
37+
"dependencies": {
38+
"snarkdown": "^2.0.0",
39+
"@floating-ui/dom": "^1.0.10",
40+
"umbrellajs": "^3.1.0"
41+
},
3742
"devDependencies": {
3843
"@babel/core": "^7.14.3",
3944
"@babel/plugin-external-helpers": "^7.12.13",
4045
"@babel/preset-env": "^7.14.4",
41-
"@floating-ui/dom": "^1.0.10",
42-
"@popperjs/core": "^2.11.6",
46+
"@babel/preset-typescript": "^7.21.5",
4347
"@rollup/plugin-babel": "^5.3.0",
4448
"@rollup/plugin-commonjs": "^19.0.0",
4549
"@rollup/plugin-node-resolve": "^13.0.0",
@@ -58,10 +62,7 @@
5862
"rollup-plugin-sass": "^1.2.2",
5963
"rollup-plugin-sizes": "^0.4.2",
6064
"rollup-plugin-terser": "^7.0.2",
61-
"sass": "^1.49.0",
62-
"scroll-into-view": "^1.15.0",
63-
"snarkdown": "^2.0.0",
64-
"umbrellajs": "^3.1.0"
65+
"sass": "^1.49.0"
6566
},
6667
"commonjs": [
6768
"node_modules/**"
@@ -77,4 +78,4 @@
7778
]
7879
},
7980
"browserslist": "> 0.25%, not dead"
80-
}
81+
}

rollup.config.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import filesize from "rollup-plugin-filesize";
2-
import { eslint } from "rollup-plugin-eslint";
2+
// import { eslint } from "rollup-plugin-eslint";
33
import babel from "@rollup/plugin-babel";
44
import commonjs from "@rollup/plugin-commonjs";
55
import resolve from "@rollup/plugin-node-resolve";
@@ -11,6 +11,7 @@ import pkg from "./package.json";
1111
const isDev = Boolean(process.argv.find((arg) => arg === "--configDev"));
1212

1313
const babelplugin = babel({
14+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
1415
babelHelpers: "bundled",
1516
exclude: pkg.commonjs
1617
});
@@ -25,6 +26,7 @@ const replaceplugin = replace({
2526
: JSON.stringify("production"),
2627
});
2728
const resolveplugin = resolve({
29+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
2830
mainFields: ["module", "jsnext:main", "browser"],
2931
browser: true,
3032
preferBuiltins: true
@@ -48,12 +50,12 @@ export default [{
4850
file: pkg.main
4951
},
5052
plugins: [
51-
eslint({
52-
fix: true,
53-
include: [
54-
"./src/**",
55-
]
56-
}),
53+
// eslint({
54+
// fix: true,
55+
// include: [
56+
// "./src/**",
57+
// ]
58+
// }),
5759
...plugins
5860
]
5961
}, {

src/Tour.scss

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
:host {
2+
position: absolute;
3+
overflow: visible;
4+
top: 0;
5+
left: 0;
6+
width: 0;
7+
height: 0;
8+
box-sizing: border-box;
9+
line-height: 1.4;
10+
text-align: left;
11+
text-rendering: optimizespeed;
12+
font-family: var(--tourguide-font-family);
13+
font-size: var(--tourguide-font-size);
14+
color: var(--tourguide-text-color);
15+
/* 1 */
16+
-webkit-text-size-adjust: 100%;
17+
/* 2 */
18+
-moz-tab-size: 4;
19+
/* 3 */
20+
tab-size: 4;
21+
/* 3 */
22+
23+
* {
24+
margin: 0;
25+
padding: 0;
26+
background: none;
27+
border: none;
28+
border-width: 0;
29+
border-style: none;
30+
border-color: currentColor;
31+
box-shadow: none;
32+
color: inherit;
33+
appearance: none;
34+
font-size: inherit;
35+
font-weight: inherit;
36+
text-decoration: none;
37+
}
38+
39+
a,
40+
button {
41+
cursor: pointer;
42+
43+
&:hover,
44+
&:focus {
45+
outline: 5px auto var(--tourguide-focus-color);
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)