@v-c/tour 1.0.0 → 1.0.2

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/dist/Mask.cjs CHANGED
@@ -1,9 +1,12 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
3
6
  let vue = require("vue");
4
- let __v_c_portal = require("@v-c/portal");
5
- __v_c_portal = require_rolldown_runtime.__toESM(__v_c_portal);
6
- let __v_c_util = require("@v-c/util");
7
+ let _v_c_portal = require("@v-c/portal");
8
+ _v_c_portal = require_rolldown_runtime.__toESM(_v_c_portal);
9
+ let _v_c_util = require("@v-c/util");
7
10
  var COVER_PROPS = {
8
11
  "fill": "transparent",
9
12
  "pointer-events": "auto"
@@ -23,12 +26,12 @@ var Mask = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
23
26
  height: "100vh"
24
27
  };
25
28
  const inlineMode = getPopupContainer === false;
26
- return (0, vue.createVNode)(__v_c_portal.default, {
29
+ return (0, vue.createVNode)(_v_c_portal.default, {
27
30
  "open": open,
28
31
  "autoLock": !inlineMode,
29
32
  "getContainer": getPopupContainer
30
33
  }, { default: () => [(0, vue.createVNode)("div", {
31
- "class": (0, __v_c_util.clsx)(`${prefixCls}-mask`, rootClassName, tourClassNames?.mask),
34
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-mask`, rootClassName, tourClassNames?.mask),
32
35
  "style": {
33
36
  position: inlineMode ? "absolute" : "fixed",
34
37
  left: `0px`,
package/dist/Mask.js CHANGED
@@ -147,9 +147,8 @@ var Mask_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
147
147
  default: void 0
148
148
  },
149
149
  getPopupContainer: {
150
- type: Boolean,
150
+ type: [Function, Boolean],
151
151
  required: false,
152
- skipCheck: true,
153
152
  default: void 0
154
153
  }
155
154
  },
@@ -1,8 +1,11 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
3
6
  let vue = require("vue");
4
- let __v_c_portal = require("@v-c/portal");
5
- __v_c_portal = require_rolldown_runtime.__toESM(__v_c_portal);
7
+ let _v_c_portal = require("@v-c/portal");
8
+ _v_c_portal = require_rolldown_runtime.__toESM(_v_c_portal);
6
9
  var Placeholder = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, attrs }) => {
7
10
  expose({
8
11
  getDom: () => {
@@ -12,7 +15,7 @@ var Placeholder = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, att
12
15
  });
13
16
  return () => {
14
17
  const { open, autoLock, getContainer } = props;
15
- return (0, vue.createVNode)(__v_c_portal.default, {
18
+ return (0, vue.createVNode)(_v_c_portal.default, {
16
19
  "open": open,
17
20
  "autoLock": autoLock,
18
21
  "getContainer": getContainer
@@ -21,7 +24,7 @@ var Placeholder = /* @__PURE__ */ (0, vue.defineComponent)((props, { expose, att
21
24
  }, {
22
25
  props: {
23
26
  domRef: {
24
- type: null,
27
+ type: Object,
25
28
  required: true,
26
29
  default: void 0
27
30
  },
@@ -18,7 +18,7 @@ var Placeholder_default = /* @__PURE__ */ defineComponent((props, { expose, attr
18
18
  }, {
19
19
  props: {
20
20
  domRef: {
21
- type: null,
21
+ type: Object,
22
22
  required: true,
23
23
  default: void 0
24
24
  },
package/dist/Tour.cjs CHANGED
@@ -1,4 +1,7 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
3
6
  const require_Mask = require("./Mask.cjs");
4
7
  const require_Placeholder = require("./Placeholder.cjs");
@@ -8,8 +11,8 @@ const require_useTarget = require("./hooks/useTarget.cjs");
8
11
  const require_placements = require("./placements.cjs");
9
12
  const require_index = require("./TourStep/index.cjs");
10
13
  let vue = require("vue");
11
- let __v_c_util = require("@v-c/util");
12
- let __v_c_trigger = require("@v-c/trigger");
14
+ let _v_c_util = require("@v-c/util");
15
+ let _v_c_trigger = require("@v-c/trigger");
13
16
  var CENTER_PLACEHOLDER = {
14
17
  left: "50%",
15
18
  top: "50%",
@@ -94,11 +97,11 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
94
97
  };
95
98
  return () => {
96
99
  const { styles, classNames, renderPanel, rootClassName, animated, zIndex = 1001, getPopupContainer, className, style, disabledInteraction, onPopupAlign } = props;
97
- const { class: attrClass, style: attrStyle,...restAttrs } = attrs;
100
+ const { class: attrClass, style: attrStyle, ...restAttrs } = attrs;
98
101
  const mergedMaskValue = mergedMask.value;
99
102
  const mergedShowMask = typeof mergedMaskValue === "boolean" ? mergedMaskValue : !!mergedMaskValue;
100
103
  const mergedMaskStyle = typeof mergedMaskValue === "boolean" ? void 0 : mergedMaskValue;
101
- const placeholderClassName = (0, __v_c_util.clsx)(className, attrClass, rootClassName, `${prefixCls.value}-target-placeholder`);
104
+ const placeholderClassName = (0, _v_c_util.clsx)(className, attrClass, rootClassName, `${prefixCls.value}-target-placeholder`);
102
105
  const placeholderStyle = {
103
106
  ...posInfo.value ? {
104
107
  left: `${posInfo.value.left}px`,
@@ -147,14 +150,14 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
147
150
  "animated": animated,
148
151
  "rootClassName": rootClassName,
149
152
  "disabledInteraction": disabledInteraction
150
- }, null), (0, vue.createVNode)(__v_c_trigger.Trigger, (0, vue.mergeProps)(restAttrs, {
153
+ }, null), (0, vue.createVNode)(_v_c_trigger.Trigger, (0, vue.mergeProps)(restAttrs, {
151
154
  "getPopupContainer": getPopupContainer,
152
155
  "builtinPlacements": mergedBuiltinPlacements.value,
153
156
  "ref": triggerRef,
154
157
  "popupStyle": stepStyle.value,
155
158
  "popupPlacement": mergedPlacement.value,
156
159
  "popupVisible": mergedOpen.value,
157
- "popupClassName": (0, __v_c_util.clsx)(rootClassName, stepClassName.value),
160
+ "popupClassName": (0, _v_c_util.clsx)(rootClassName, stepClassName.value),
158
161
  "prefixCls": prefixCls.value,
159
162
  "popup": popupElement,
160
163
  "forceRender": false,
@@ -190,7 +193,7 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
190
193
  default: void 0
191
194
  },
192
195
  style: {
193
- type: null,
196
+ type: Object,
194
197
  required: false,
195
198
  default: void 0
196
199
  },
@@ -236,6 +239,8 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
236
239
  },
237
240
  closeIcon: {
238
241
  type: [
242
+ Object,
243
+ Function,
239
244
  String,
240
245
  Number,
241
246
  null,
@@ -243,7 +248,6 @@ var Tour = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
243
248
  Array
244
249
  ],
245
250
  required: false,
246
- skipCheck: true,
247
251
  default: void 0
248
252
  },
249
253
  closable: {
package/dist/Tour.js CHANGED
@@ -92,7 +92,7 @@ var Tour_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
92
92
  };
93
93
  return () => {
94
94
  const { styles, classNames, renderPanel, rootClassName, animated, zIndex = 1001, getPopupContainer, className, style, disabledInteraction, onPopupAlign } = props;
95
- const { class: attrClass, style: attrStyle,...restAttrs } = attrs;
95
+ const { class: attrClass, style: attrStyle, ...restAttrs } = attrs;
96
96
  const mergedMaskValue = mergedMask.value;
97
97
  const mergedShowMask = typeof mergedMaskValue === "boolean" ? mergedMaskValue : !!mergedMaskValue;
98
98
  const mergedMaskStyle = typeof mergedMaskValue === "boolean" ? void 0 : mergedMaskValue;
@@ -188,7 +188,7 @@ var Tour_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
188
188
  default: void 0
189
189
  },
190
190
  style: {
191
- type: null,
191
+ type: Object,
192
192
  required: false,
193
193
  default: void 0
194
194
  },
@@ -234,6 +234,8 @@ var Tour_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
234
234
  },
235
235
  closeIcon: {
236
236
  type: [
237
+ Object,
238
+ Function,
237
239
  String,
238
240
  Number,
239
241
  null,
@@ -241,7 +243,6 @@ var Tour_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
241
243
  Array
242
244
  ],
243
245
  required: false,
244
- skipCheck: true,
245
246
  default: void 0
246
247
  },
247
248
  closable: {
@@ -1,18 +1,21 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
3
6
  let vue = require("vue");
4
- let __v_c_util = require("@v-c/util");
5
- let __v_c_util_dist_pickAttrs = require("@v-c/util/dist/pickAttrs");
6
- __v_c_util_dist_pickAttrs = require_rolldown_runtime.__toESM(__v_c_util_dist_pickAttrs);
7
+ let _v_c_util = require("@v-c/util");
8
+ let _v_c_util_dist_pickAttrs = require("@v-c/util/dist/pickAttrs");
9
+ _v_c_util_dist_pickAttrs = require_rolldown_runtime.__toESM(_v_c_util_dist_pickAttrs);
7
10
  var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
8
11
  return () => {
9
12
  const { prefixCls, current, total, title, description, onClose, onPrev, onNext, onFinish, closable, classNames: tourClassNames, styles } = props;
10
- const ariaProps = (0, __v_c_util_dist_pickAttrs.default)(closable || {}, true);
13
+ const ariaProps = (0, _v_c_util_dist_pickAttrs.default)(closable || {}, true);
11
14
  const closeIcon = closable?.closeIcon ?? (0, vue.createVNode)("span", { "class": `${prefixCls}-close-x` }, [(0, vue.createTextVNode)("×")]);
12
15
  const mergedClosable = !!closable;
13
16
  const className = attrs.class;
14
- return (0, vue.createVNode)("div", { "class": (0, __v_c_util.clsx)(`${prefixCls}-panel`, className) }, [(0, vue.createVNode)("div", {
15
- "class": (0, __v_c_util.clsx)(`${prefixCls}-section`, tourClassNames?.section),
17
+ return (0, vue.createVNode)("div", { "class": (0, _v_c_util.clsx)(`${prefixCls}-panel`, className) }, [(0, vue.createVNode)("div", {
18
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-section`, tourClassNames?.section),
16
19
  "style": styles?.section
17
20
  }, [
18
21
  mergedClosable && (0, vue.createVNode)("button", (0, vue.mergeProps)({
@@ -21,18 +24,18 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
21
24
  "aria-label": "Close"
22
25
  }, ariaProps, { "class": `${prefixCls}-close` }), [closeIcon]),
23
26
  (0, vue.createVNode)("div", {
24
- "class": (0, __v_c_util.clsx)(`${prefixCls}-header`, tourClassNames?.header),
27
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-header`, tourClassNames?.header),
25
28
  "style": styles?.header
26
29
  }, [(0, vue.createVNode)("div", {
27
- "class": (0, __v_c_util.clsx)(`${prefixCls}-title`, tourClassNames?.title),
30
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-title`, tourClassNames?.title),
28
31
  "style": styles?.title
29
32
  }, [title])]),
30
33
  (0, vue.createVNode)("div", {
31
- "class": (0, __v_c_util.clsx)(`${prefixCls}-description`, tourClassNames?.description),
34
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-description`, tourClassNames?.description),
32
35
  "style": styles?.description
33
36
  }, [description]),
34
37
  (0, vue.createVNode)("div", {
35
- "class": (0, __v_c_util.clsx)(`${prefixCls}-footer`, tourClassNames?.footer),
38
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-footer`, tourClassNames?.footer),
36
39
  "style": styles?.footer
37
40
  }, [(0, vue.createVNode)("div", { "class": `${prefixCls}-sliders` }, [total > 1 ? [...Array.from({ length: total }).keys()].map((item, index) => {
38
41
  return (0, vue.createVNode)("span", {
@@ -40,7 +43,7 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
40
43
  "class": index === current ? "active" : ""
41
44
  }, null);
42
45
  }) : null]), (0, vue.createVNode)("div", {
43
- "class": (0, __v_c_util.clsx)(`${prefixCls}-actions`, tourClassNames?.actions),
46
+ "class": (0, _v_c_util.clsx)(`${prefixCls}-actions`, tourClassNames?.actions),
44
47
  "style": styles?.actions
45
48
  }, [current !== 0 ? (0, vue.createVNode)("button", {
46
49
  "class": `${prefixCls}-prev-btn`,
@@ -112,13 +115,19 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
112
115
  default: void 0
113
116
  },
114
117
  target: {
115
- type: [null, Function],
118
+ type: [
119
+ Object,
120
+ null,
121
+ Function
122
+ ],
116
123
  required: false,
117
124
  skipCheck: true,
118
125
  default: void 0
119
126
  },
120
127
  title: {
121
128
  type: [
129
+ Object,
130
+ Function,
122
131
  String,
123
132
  Number,
124
133
  null,
@@ -126,11 +135,12 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
126
135
  Array
127
136
  ],
128
137
  required: true,
129
- skipCheck: true,
130
138
  default: void 0
131
139
  },
132
140
  description: {
133
141
  type: [
142
+ Object,
143
+ Function,
134
144
  String,
135
145
  Number,
136
146
  null,
@@ -138,7 +148,6 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
138
148
  Array
139
149
  ],
140
150
  required: false,
141
- skipCheck: true,
142
151
  default: void 0
143
152
  },
144
153
  placement: {
@@ -152,7 +161,7 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
152
161
  default: void 0
153
162
  },
154
163
  style: {
155
- type: null,
164
+ type: Object,
156
165
  required: false,
157
166
  default: void 0
158
167
  },
@@ -169,6 +178,8 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
169
178
  },
170
179
  closeIcon: {
171
180
  type: [
181
+ Object,
182
+ Function,
172
183
  String,
173
184
  Number,
174
185
  null,
@@ -176,7 +187,6 @@ var DefaultPanel = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) =
176
187
  Array
177
188
  ],
178
189
  required: false,
179
- skipCheck: true,
180
190
  default: void 0
181
191
  },
182
192
  closable: {
@@ -109,13 +109,19 @@ var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
109
109
  default: void 0
110
110
  },
111
111
  target: {
112
- type: [null, Function],
112
+ type: [
113
+ Object,
114
+ null,
115
+ Function
116
+ ],
113
117
  required: false,
114
118
  skipCheck: true,
115
119
  default: void 0
116
120
  },
117
121
  title: {
118
122
  type: [
123
+ Object,
124
+ Function,
119
125
  String,
120
126
  Number,
121
127
  null,
@@ -123,11 +129,12 @@ var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
123
129
  Array
124
130
  ],
125
131
  required: true,
126
- skipCheck: true,
127
132
  default: void 0
128
133
  },
129
134
  description: {
130
135
  type: [
136
+ Object,
137
+ Function,
131
138
  String,
132
139
  Number,
133
140
  null,
@@ -135,7 +142,6 @@ var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
135
142
  Array
136
143
  ],
137
144
  required: false,
138
- skipCheck: true,
139
145
  default: void 0
140
146
  },
141
147
  placement: {
@@ -149,7 +155,7 @@ var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
149
155
  default: void 0
150
156
  },
151
157
  style: {
152
- type: null,
158
+ type: Object,
153
159
  required: false,
154
160
  default: void 0
155
161
  },
@@ -166,6 +172,8 @@ var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
166
172
  },
167
173
  closeIcon: {
168
174
  type: [
175
+ Object,
176
+ Function,
169
177
  String,
170
178
  Number,
171
179
  null,
@@ -173,7 +181,6 @@ var DefaultPanel_default = /* @__PURE__ */ defineComponent((props, { attrs }) =>
173
181
  Array
174
182
  ],
175
183
  required: false,
176
- skipCheck: true,
177
184
  default: void 0
178
185
  },
179
186
  closable: {
@@ -1,4 +1,7 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
3
6
  const require_DefaultPanel = require("./DefaultPanel.cjs");
4
7
  let vue = require("vue");
@@ -68,13 +71,19 @@ var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
68
71
  default: void 0
69
72
  },
70
73
  target: {
71
- type: [null, Function],
74
+ type: [
75
+ Object,
76
+ null,
77
+ Function
78
+ ],
72
79
  required: false,
73
80
  skipCheck: true,
74
81
  default: void 0
75
82
  },
76
83
  title: {
77
84
  type: [
85
+ Object,
86
+ Function,
78
87
  String,
79
88
  Number,
80
89
  null,
@@ -82,11 +91,12 @@ var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
82
91
  Array
83
92
  ],
84
93
  required: true,
85
- skipCheck: true,
86
94
  default: void 0
87
95
  },
88
96
  description: {
89
97
  type: [
98
+ Object,
99
+ Function,
90
100
  String,
91
101
  Number,
92
102
  null,
@@ -94,7 +104,6 @@ var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
94
104
  Array
95
105
  ],
96
106
  required: false,
97
- skipCheck: true,
98
107
  default: void 0
99
108
  },
100
109
  placement: {
@@ -108,7 +117,7 @@ var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
108
117
  default: void 0
109
118
  },
110
119
  style: {
111
- type: null,
120
+ type: Object,
112
121
  required: false,
113
122
  default: void 0
114
123
  },
@@ -125,6 +134,8 @@ var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
125
134
  },
126
135
  closeIcon: {
127
136
  type: [
137
+ Object,
138
+ Function,
128
139
  String,
129
140
  Number,
130
141
  null,
@@ -132,7 +143,6 @@ var TourStep = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
132
143
  Array
133
144
  ],
134
145
  required: false,
135
- skipCheck: true,
136
146
  default: void 0
137
147
  },
138
148
  closable: {
@@ -66,13 +66,19 @@ var TourStep_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
66
66
  default: void 0
67
67
  },
68
68
  target: {
69
- type: [null, Function],
69
+ type: [
70
+ Object,
71
+ null,
72
+ Function
73
+ ],
70
74
  required: false,
71
75
  skipCheck: true,
72
76
  default: void 0
73
77
  },
74
78
  title: {
75
79
  type: [
80
+ Object,
81
+ Function,
76
82
  String,
77
83
  Number,
78
84
  null,
@@ -80,11 +86,12 @@ var TourStep_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
80
86
  Array
81
87
  ],
82
88
  required: true,
83
- skipCheck: true,
84
89
  default: void 0
85
90
  },
86
91
  description: {
87
92
  type: [
93
+ Object,
94
+ Function,
88
95
  String,
89
96
  Number,
90
97
  null,
@@ -92,7 +99,6 @@ var TourStep_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
92
99
  Array
93
100
  ],
94
101
  required: false,
95
- skipCheck: true,
96
102
  default: void 0
97
103
  },
98
104
  placement: {
@@ -106,7 +112,7 @@ var TourStep_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
106
112
  default: void 0
107
113
  },
108
114
  style: {
109
- type: null,
115
+ type: Object,
110
116
  required: false,
111
117
  default: void 0
112
118
  },
@@ -123,6 +129,8 @@ var TourStep_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
123
129
  },
124
130
  closeIcon: {
125
131
  type: [
132
+ Object,
133
+ Function,
126
134
  String,
127
135
  Number,
128
136
  null,
@@ -130,7 +138,6 @@ var TourStep_default = /* @__PURE__ */ defineComponent((props, { attrs }) => {
130
138
  Array
131
139
  ],
132
140
  required: false,
133
- skipCheck: true,
134
141
  default: void 0
135
142
  },
136
143
  closable: {
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
1
2
  const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
2
3
  let vue = require("vue");
3
4
  function isConfigObj(closable) {
@@ -1,17 +1,23 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
3
6
  const require_util = require("../util.cjs");
4
7
  let vue = require("vue");
5
- let __v_c_util_dist_vnode = require("@v-c/util/dist/vnode");
8
+ let _v_c_util_dist_Dom_canUseDom = require("@v-c/util/dist/Dom/canUseDom");
9
+ _v_c_util_dist_Dom_canUseDom = require_rolldown_runtime.__toESM(_v_c_util_dist_Dom_canUseDom);
10
+ let _v_c_util_dist_vnode = require("@v-c/util/dist/vnode");
6
11
  function isValidNumber(val) {
7
12
  return typeof val === "number" && !Number.isNaN(val);
8
13
  }
9
14
  function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeholderRef) {
10
15
  const targetElement = (0, vue.shallowRef)(null);
11
16
  const syncTargetElement = () => {
12
- targetElement.value = (0, __v_c_util_dist_vnode.resolveToElement)((typeof target.value === "function" ? target.value() : target.value) || null);
17
+ targetElement.value = (0, _v_c_util_dist_vnode.resolveToElement)((typeof target.value === "function" ? target.value() : target.value) || null);
13
18
  };
14
19
  (0, vue.watch)(target, () => {
20
+ if (!(0, _v_c_util_dist_Dom_canUseDom.default)()) return;
15
21
  syncTargetElement();
16
22
  }, {
17
23
  immediate: true,
@@ -46,6 +52,7 @@ function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeho
46
52
  });
47
53
  const getGapOffset = (index) => (Array.isArray(gap?.value?.offset) ? gap?.value?.offset[index] : gap?.value?.offset) ?? 6;
48
54
  (0, vue.watch)([targetElement, open], async (_n, _o, onCleanup) => {
55
+ if (!(0, _v_c_util_dist_Dom_canUseDom.default)()) return;
49
56
  await (0, vue.nextTick)();
50
57
  updatePos();
51
58
  window.addEventListener("resize", updatePos);
@@ -1,5 +1,6 @@
1
1
  import { isInViewPort } from "../util.js";
2
2
  import { computed, nextTick, onMounted, shallowRef, watch } from "vue";
3
+ import canUseDom from "@v-c/util/dist/Dom/canUseDom";
3
4
  import { resolveToElement } from "@v-c/util/dist/vnode";
4
5
  function isValidNumber(val) {
5
6
  return typeof val === "number" && !Number.isNaN(val);
@@ -10,6 +11,7 @@ function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeho
10
11
  targetElement.value = resolveToElement((typeof target.value === "function" ? target.value() : target.value) || null);
11
12
  };
12
13
  watch(target, () => {
14
+ if (!canUseDom()) return;
13
15
  syncTargetElement();
14
16
  }, {
15
17
  immediate: true,
@@ -44,6 +46,7 @@ function useTarget(target, open, gap, scrollIntoViewOptions, inlineMode, placeho
44
46
  });
45
47
  const getGapOffset = (index) => (Array.isArray(gap?.value?.offset) ? gap?.value?.offset[index] : gap?.value?.offset) ?? 6;
46
48
  watch([targetElement, open], async (_n, _o, onCleanup) => {
49
+ if (!canUseDom()) return;
47
50
  await nextTick();
48
51
  updatePos();
49
52
  window.addEventListener("resize", updatePos);
package/dist/index.cjs CHANGED
@@ -1,4 +1,7 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
2
5
  const require_Tour = require("./Tour.cjs");
3
6
  var src_default = require_Tour.default;
4
7
  exports.default = src_default;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
1
2
  var targetOffset = [0, 0];
2
3
  var basePlacements = {
3
4
  left: {
package/dist/util.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
1
2
  function isInViewPort(element) {
2
3
  const viewWidth = window.innerWidth || document.documentElement.clientWidth;
3
4
  const viewHeight = window.innerHeight || document.documentElement.clientHeight;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/tour",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,9 +29,9 @@
29
29
  "vue": "^3.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@v-c/portal": "^1.0.0",
33
- "@v-c/trigger": "^1.0.0",
34
- "@v-c/util": "^1.0.0"
32
+ "@v-c/portal": "^1.0.5",
33
+ "@v-c/trigger": "^1.0.5",
34
+ "@v-c/util": "^1.0.8"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "vite build",