@aquera/nile-elements 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/demo/index.html +108 -94
- package/dist/nile-form-help-text/nile-form-help-text.cjs.js +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.cjs.js.map +1 -1
- package/dist/nile-form-help-text/nile-form-help-text.esm.js +1 -1
- package/dist/nile-tour/nile-tour.cjs.js +1 -1
- package/dist/nile-tour/nile-tour.cjs.js.map +1 -1
- package/dist/nile-tour/nile-tour.css.cjs.js +1 -1
- package/dist/nile-tour/nile-tour.css.cjs.js.map +1 -1
- package/dist/nile-tour/nile-tour.css.esm.js +112 -23
- package/dist/nile-tour/nile-tour.esm.js +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.js +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.js.map +1 -1
- package/dist/src/nile-tour/nile-tour.css.js +110 -21
- package/dist/src/nile-tour/nile-tour.css.js.map +1 -1
- package/dist/src/nile-tour/nile-tour.d.ts +1 -1
- package/dist/src/nile-tour/nile-tour.js +23 -5
- package/dist/src/nile-tour/nile-tour.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-form-help-text/nile-form-help-text.ts +1 -1
- package/src/nile-tour/nile-tour.css.ts +110 -21
- package/src/nile-tour/nile-tour.ts +25 -6
- package/vscode-html-custom-data.json +2 -2
package/package.json
CHANGED
@@ -111,7 +111,7 @@ declare global {
|
|
111
111
|
|
112
112
|
function concatSentence(sentence:string, n:number) {
|
113
113
|
if (n < 0 || n > sentence.length) {
|
114
|
-
|
114
|
+
return n;
|
115
115
|
}
|
116
116
|
|
117
117
|
// Adjust n if it falls in the middle of a word
|
@@ -15,34 +15,99 @@ export const styles = css`
|
|
15
15
|
}
|
16
16
|
|
17
17
|
.introjs-tooltip {
|
18
|
-
background-color: var(--nile-tour-background-color, #
|
18
|
+
background-color: var(--nile-tour-background-color, #fff);
|
19
19
|
color: var(--nile-tour-text-color, #fff);
|
20
20
|
width: 300px;
|
21
21
|
max-width: 300px;
|
22
|
+
border-radius: 4px;
|
23
|
+
border: 1px solid var(--Neutral-30, #c7ced4);
|
24
|
+
background: var(--White-Normal, #fff);
|
25
|
+
|
26
|
+
/* Elevation/Lifted */
|
27
|
+
box-shadow: 0px 4px 8px 0px rgba(119, 125, 130, 0.15);
|
22
28
|
}
|
23
29
|
|
24
|
-
.introjs-
|
25
|
-
|
30
|
+
.introjs-tooltip-title {
|
31
|
+
color: #000;
|
32
|
+
font-size: 16px;
|
33
|
+
font-style: normal;
|
34
|
+
font-weight: 500;
|
35
|
+
line-height: 16px;
|
36
|
+
letter-spacing: 0.2px;
|
37
|
+
}
|
38
|
+
|
39
|
+
.introjs-tooltip-header {
|
40
|
+
padding-left: 18px;
|
41
|
+
padding-right: 18px;
|
42
|
+
padding-top: 18px;
|
43
|
+
}
|
44
|
+
|
45
|
+
.introjs-tooltiptext {
|
46
|
+
color: #7f7f7f;
|
47
|
+
font-size: 14px;
|
48
|
+
font-style: normal;
|
49
|
+
font-weight: 400;
|
50
|
+
line-height: 20px;
|
51
|
+
letter-spacing: 0.2px;
|
52
|
+
padding: 15px 18px;
|
53
|
+
}
|
54
|
+
|
55
|
+
.introjs-arrow {
|
56
|
+
width: 15px;
|
57
|
+
height: 20px;
|
58
|
+
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="15" height="20" viewBox="0 0 15 20" fill="none"%3E%3Cpath d="M1.43333 11.2C0.633333 10.6 0.633333 9.4 1.43333 8.8L12.1 0.800001C13.0889 0.0583585 14.5 0.763931 14.5 2L14.5 18C14.5 19.2361 13.0889 19.9416 12.1 19.2L1.43333 11.2Z" fill="white" stroke="%23C7CED4"/%3E%3C/svg%3E');
|
59
|
+
background-repeat: no-repeat;
|
60
|
+
background-size: contain;
|
61
|
+
background-position: center;
|
62
|
+
position: absolute;
|
63
|
+
border: none;
|
64
|
+
content: none;
|
26
65
|
}
|
27
66
|
|
28
67
|
.introjs-arrow.top {
|
29
|
-
|
68
|
+
top: -14.5px;
|
69
|
+
transform: rotate(90deg);
|
70
|
+
clip-path: inset(0px 3px 0px 0px);
|
71
|
+
}
|
72
|
+
|
73
|
+
.introjs-arrow.bottom {
|
74
|
+
bottom: -14.5px;
|
75
|
+
transform: rotate(270deg);
|
76
|
+
clip-path: inset(0px 3px 0px 0px);
|
30
77
|
}
|
31
78
|
|
32
79
|
.introjs-arrow.left {
|
33
|
-
|
80
|
+
left: -11.5px;
|
81
|
+
transform: rotate(0);
|
82
|
+
clip-path: inset(0px 3px 0px 0px);
|
34
83
|
}
|
35
84
|
|
36
85
|
.introjs-arrow.right {
|
37
|
-
|
86
|
+
right: -12px;
|
87
|
+
transform: rotate(180deg);
|
88
|
+
clip-path: inset(0px 3px 0px 0px);
|
38
89
|
}
|
39
90
|
|
40
91
|
.introjs-arrow.left-bottom {
|
41
|
-
|
92
|
+
transform: rotate(0);
|
93
|
+
clip-path: inset(0px 1px 0px 0px);
|
94
|
+
left: -13.5px;
|
95
|
+
border-right-color: var(--nile-tour-background-color, #fff) !important;
|
42
96
|
}
|
43
97
|
|
44
98
|
.introjs-arrow.right-bottom {
|
45
|
-
|
99
|
+
right: -12px;
|
100
|
+
transform: rotate(180deg);
|
101
|
+
clip-path: inset(0px 3px 0px 0px);
|
102
|
+
border-left-color: var(--nile-tour-background-color, #fff) !important;
|
103
|
+
}
|
104
|
+
|
105
|
+
.introjs-arrow.top-middle {
|
106
|
+
top: -14px;
|
107
|
+
left: 50%;
|
108
|
+
margin-left: -5px;
|
109
|
+
transform: rotate(90deg);
|
110
|
+
clip-path: inset(0px 3px 0px 0px);
|
46
111
|
}
|
47
112
|
|
48
113
|
.introjs-button {
|
@@ -53,26 +118,46 @@ export const styles = css`
|
|
53
118
|
padding: 0;
|
54
119
|
cursor: pointer;
|
55
120
|
text-shadow: none;
|
56
|
-
background:
|
121
|
+
background: var(--Primary-Normal, #005ea6);
|
57
122
|
border-color: transparent;
|
123
|
+
display: flex;
|
124
|
+
padding: 12px;
|
125
|
+
align-items: center;
|
126
|
+
gap: 12px;
|
127
|
+
border-radius: 4px;
|
58
128
|
}
|
59
129
|
|
60
130
|
.introjs-button:hover {
|
61
|
-
|
62
|
-
|
131
|
+
background: none;
|
132
|
+
border: none;
|
133
|
+
color: var(--nile-tour-text-color, #fff);
|
134
|
+
font-size: 14px;
|
135
|
+
padding: 0;
|
136
|
+
cursor: pointer;
|
137
|
+
text-shadow: none;
|
138
|
+
background: var(--Primary-Normal, #005ea6);
|
63
139
|
border-color: transparent;
|
64
|
-
|
65
|
-
|
140
|
+
display: flex;
|
141
|
+
padding: 12px;
|
142
|
+
align-items: center;
|
143
|
+
gap: 12px;
|
66
144
|
}
|
67
145
|
|
68
146
|
.introjs-button:focus {
|
69
|
-
|
70
|
-
text-decoration: none;
|
71
|
-
border-color: transparent;
|
72
|
-
background: transparent;
|
73
|
-
color: white;
|
147
|
+
background: none;
|
74
148
|
border: none;
|
149
|
+
color: var(--nile-tour-text-color, #fff);
|
150
|
+
font-size: 14px;
|
151
|
+
padding: 0;
|
152
|
+
cursor: pointer;
|
153
|
+
text-shadow: none;
|
75
154
|
box-shadow: none;
|
155
|
+
background: var(--Primary-Normal, #005ea6);
|
156
|
+
border-color: transparent;
|
157
|
+
display: flex;
|
158
|
+
padding: 12px;
|
159
|
+
align-items: center;
|
160
|
+
gap: 12px;
|
76
161
|
}
|
77
162
|
|
78
163
|
.introjs-tooltipbuttons {
|
@@ -109,12 +194,16 @@ export const styles = css`
|
|
109
194
|
}
|
110
195
|
|
111
196
|
.introjs-step-counter {
|
112
|
-
margin-right: auto;
|
197
|
+
margin-right: auto;
|
113
198
|
font-size: 14px;
|
114
|
-
color: #ffffff;
|
115
199
|
padding: 0 10px;
|
116
200
|
display: flex;
|
117
201
|
align-items: center;
|
202
|
+
color: var(--Color-Text-Info, #1978B8);
|
203
|
+
font-style: normal;
|
204
|
+
font-weight: 400;
|
205
|
+
line-height: 14px;
|
206
|
+
letter-spacing: 0.2px;
|
118
207
|
}
|
119
208
|
|
120
209
|
@keyframes shake {
|
@@ -136,7 +225,7 @@ export const styles = css`
|
|
136
225
|
}
|
137
226
|
|
138
227
|
.introjs-shake {
|
139
|
-
animation: shake 0.5s ease infinite;
|
228
|
+
animation: shake 0.5s ease infinite;
|
140
229
|
}
|
141
230
|
`;
|
142
231
|
|
@@ -28,7 +28,7 @@ export class NileTour extends LitElement {
|
|
28
28
|
element: string;
|
29
29
|
title: string;
|
30
30
|
content: string;
|
31
|
-
position:
|
31
|
+
position: any;
|
32
32
|
beforeChange?: () => Promise<boolean> | boolean;
|
33
33
|
afterChange?: () => Promise<void> | void;
|
34
34
|
}> = [];
|
@@ -101,13 +101,13 @@ export class NileTour extends LitElement {
|
|
101
101
|
position: step.position,
|
102
102
|
beforeChange: step.beforeChange,
|
103
103
|
afterChange: step.afterChange,
|
104
|
-
}))
|
105
|
-
.filter((step) => step.element !== null);
|
104
|
+
}));
|
105
|
+
// .filter((step) => step.element !== null);
|
106
106
|
|
107
107
|
this.tourInstance = introJs().setOptions({
|
108
108
|
steps: introSteps,
|
109
|
-
nextLabel: "
|
110
|
-
prevLabel: "
|
109
|
+
nextLabel: "Next",
|
110
|
+
prevLabel: "Prev",
|
111
111
|
overlayOpacity: 0,
|
112
112
|
disableInteraction: this.disableInteraction,
|
113
113
|
showButtons: true,
|
@@ -157,7 +157,26 @@ export class NileTour extends LitElement {
|
|
157
157
|
}
|
158
158
|
});
|
159
159
|
|
160
|
-
|
160
|
+
|
161
|
+
|
162
|
+
this.tourInstance.start().then(() => {
|
163
|
+
const currentStep = this.tourInstance?._currentStep ?? 0;
|
164
|
+
const totalSteps = this.steps.length;
|
165
|
+
const tooltip = document.querySelector('.introjs-tooltip');
|
166
|
+
if (tooltip) {
|
167
|
+
const navBar = tooltip.querySelector('.introjs-tooltipbuttons');
|
168
|
+
if (navBar) {
|
169
|
+
let stepCounter = navBar.querySelector('.introjs-step-counter') as HTMLElement;
|
170
|
+
if (!stepCounter) {
|
171
|
+
stepCounter = document.createElement('div');
|
172
|
+
stepCounter.className = 'introjs-step-counter';
|
173
|
+
navBar.insertBefore(stepCounter, navBar.firstChild);
|
174
|
+
}
|
175
|
+
stepCounter.textContent = `${currentStep + 1} of ${totalSteps}`;
|
176
|
+
}
|
177
|
+
} }).catch(err => {
|
178
|
+
console.error('Error starting the tour:', err);
|
179
|
+
});
|
161
180
|
}
|
162
181
|
|
163
182
|
private shakeTooltip(): void {
|
@@ -3766,11 +3766,11 @@
|
|
3766
3766
|
},
|
3767
3767
|
{
|
3768
3768
|
"name": "nile-tour",
|
3769
|
-
"description": "Nile tour component.\n\nAttributes:\n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position:
|
3769
|
+
"description": "Nile tour component.\n\nAttributes:\n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position: any; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<void>) | undefined; }[]`} - The steps for the tour.\n\n * `stepsJson` {`string`} - JSON string for steps.\n\n * `showBackdrop` {`boolean`} - Whether to show the backdrop overlay.\n\n * `disableInteraction` {`boolean`} - Whether to disable interaction during the tour.\n\nProperties:\n\n * `tourInstance` - \n\n * `steps` {`{ stepNo: number; element: string; title: string; content: string; position: any; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<void>) | undefined; }[]`} - The steps for the tour.\n\n * `stepsJson` {`string`} - JSON string for steps.\n\n * `showBackdrop` {`boolean`} - Whether to show the backdrop overlay.\n\n * `disableInteraction` {`boolean`} - Whether to disable interaction during the tour.",
|
3770
3770
|
"attributes": [
|
3771
3771
|
{
|
3772
3772
|
"name": "steps",
|
3773
|
-
"description": "`steps` {`{ stepNo: number; element: string; title: string; content: string; position:
|
3773
|
+
"description": "`steps` {`{ stepNo: number; element: string; title: string; content: string; position: any; beforeChange?: (() => boolean | Promise<boolean>) | undefined; afterChange?: (() => void | Promise<void>) | undefined; }[]`} - The steps for the tour.\n\nProperty: steps\n\nDefault: "
|
3774
3774
|
},
|
3775
3775
|
{
|
3776
3776
|
"name": "stepsJson",
|