@sirendesign/markup 1.0.24 → 1.0.25
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/index.esm.js +183 -380
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +279 -476
- package/dist/index.js.map +1 -1
- package/dist/markup-widget.esm.js +227 -245
- package/dist/markup-widget.esm.js.map +1 -1
- package/dist/markup-widget.js +226 -244
- package/dist/markup-widget.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
3
|
+
import React, { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
|
|
6
6
|
const createStoreImpl = (createState) => {
|
|
@@ -40,85 +40,10 @@ function getDefaultExportFromCjs (x) {
|
|
|
40
40
|
|
|
41
41
|
var withSelector = {exports: {}};
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var withSelector_development = {};
|
|
44
44
|
|
|
45
45
|
var shim = {exports: {}};
|
|
46
46
|
|
|
47
|
-
var useSyncExternalStoreShim_production = {};
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @license React
|
|
51
|
-
* use-sync-external-store-shim.production.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
var hasRequiredUseSyncExternalStoreShim_production;
|
|
60
|
-
|
|
61
|
-
function requireUseSyncExternalStoreShim_production () {
|
|
62
|
-
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
63
|
-
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
64
|
-
var React = require$$0;
|
|
65
|
-
function is(x, y) {
|
|
66
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
67
|
-
}
|
|
68
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
69
|
-
useState = React.useState,
|
|
70
|
-
useEffect = React.useEffect,
|
|
71
|
-
useLayoutEffect = React.useLayoutEffect,
|
|
72
|
-
useDebugValue = React.useDebugValue;
|
|
73
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
74
|
-
var value = getSnapshot(),
|
|
75
|
-
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
76
|
-
inst = _useState[0].inst,
|
|
77
|
-
forceUpdate = _useState[1];
|
|
78
|
-
useLayoutEffect(
|
|
79
|
-
function () {
|
|
80
|
-
inst.value = value;
|
|
81
|
-
inst.getSnapshot = getSnapshot;
|
|
82
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
83
|
-
},
|
|
84
|
-
[subscribe, value, getSnapshot]
|
|
85
|
-
);
|
|
86
|
-
useEffect(
|
|
87
|
-
function () {
|
|
88
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
89
|
-
return subscribe(function () {
|
|
90
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
[subscribe]
|
|
94
|
-
);
|
|
95
|
-
useDebugValue(value);
|
|
96
|
-
return value;
|
|
97
|
-
}
|
|
98
|
-
function checkIfSnapshotChanged(inst) {
|
|
99
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
100
|
-
inst = inst.value;
|
|
101
|
-
try {
|
|
102
|
-
var nextValue = latestGetSnapshot();
|
|
103
|
-
return !objectIs(inst, nextValue);
|
|
104
|
-
} catch (error) {
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
109
|
-
return getSnapshot();
|
|
110
|
-
}
|
|
111
|
-
var shim =
|
|
112
|
-
"undefined" === typeof window ||
|
|
113
|
-
"undefined" === typeof window.document ||
|
|
114
|
-
"undefined" === typeof window.document.createElement
|
|
115
|
-
? useSyncExternalStore$1
|
|
116
|
-
: useSyncExternalStore$2;
|
|
117
|
-
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
118
|
-
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
119
|
-
return useSyncExternalStoreShim_production;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
47
|
var useSyncExternalStoreShim_development = {};
|
|
123
48
|
|
|
124
49
|
/**
|
|
@@ -130,206 +55,95 @@ var useSyncExternalStoreShim_development = {};
|
|
|
130
55
|
* This source code is licensed under the MIT license found in the
|
|
131
56
|
* LICENSE file in the root directory of this source tree.
|
|
132
57
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
})();
|
|
223
|
-
return useSyncExternalStoreShim_development;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
var hasRequiredShim;
|
|
227
|
-
|
|
228
|
-
function requireShim () {
|
|
229
|
-
if (hasRequiredShim) return shim.exports;
|
|
230
|
-
hasRequiredShim = 1;
|
|
231
|
-
|
|
232
|
-
if (process.env.NODE_ENV === 'production') {
|
|
233
|
-
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
234
|
-
} else {
|
|
235
|
-
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
236
|
-
}
|
|
237
|
-
return shim.exports;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* @license React
|
|
242
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
243
|
-
*
|
|
244
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
245
|
-
*
|
|
246
|
-
* This source code is licensed under the MIT license found in the
|
|
247
|
-
* LICENSE file in the root directory of this source tree.
|
|
248
|
-
*/
|
|
249
|
-
|
|
250
|
-
var hasRequiredWithSelector_production;
|
|
251
|
-
|
|
252
|
-
function requireWithSelector_production () {
|
|
253
|
-
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
254
|
-
hasRequiredWithSelector_production = 1;
|
|
255
|
-
var React = require$$0,
|
|
256
|
-
shim = requireShim();
|
|
257
|
-
function is(x, y) {
|
|
258
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
259
|
-
}
|
|
260
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
261
|
-
useSyncExternalStore = shim.useSyncExternalStore,
|
|
262
|
-
useRef = React.useRef,
|
|
263
|
-
useEffect = React.useEffect,
|
|
264
|
-
useMemo = React.useMemo,
|
|
265
|
-
useDebugValue = React.useDebugValue;
|
|
266
|
-
withSelector_production.useSyncExternalStoreWithSelector = function (
|
|
267
|
-
subscribe,
|
|
268
|
-
getSnapshot,
|
|
269
|
-
getServerSnapshot,
|
|
270
|
-
selector,
|
|
271
|
-
isEqual
|
|
272
|
-
) {
|
|
273
|
-
var instRef = useRef(null);
|
|
274
|
-
if (null === instRef.current) {
|
|
275
|
-
var inst = { hasValue: false, value: null };
|
|
276
|
-
instRef.current = inst;
|
|
277
|
-
} else inst = instRef.current;
|
|
278
|
-
instRef = useMemo(
|
|
279
|
-
function () {
|
|
280
|
-
function memoizedSelector(nextSnapshot) {
|
|
281
|
-
if (!hasMemo) {
|
|
282
|
-
hasMemo = true;
|
|
283
|
-
memoizedSnapshot = nextSnapshot;
|
|
284
|
-
nextSnapshot = selector(nextSnapshot);
|
|
285
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
286
|
-
var currentSelection = inst.value;
|
|
287
|
-
if (isEqual(currentSelection, nextSnapshot))
|
|
288
|
-
return (memoizedSelection = currentSelection);
|
|
289
|
-
}
|
|
290
|
-
return (memoizedSelection = nextSnapshot);
|
|
291
|
-
}
|
|
292
|
-
currentSelection = memoizedSelection;
|
|
293
|
-
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
294
|
-
var nextSelection = selector(nextSnapshot);
|
|
295
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
296
|
-
return (memoizedSnapshot = nextSnapshot), currentSelection;
|
|
297
|
-
memoizedSnapshot = nextSnapshot;
|
|
298
|
-
return (memoizedSelection = nextSelection);
|
|
299
|
-
}
|
|
300
|
-
var hasMemo = false,
|
|
301
|
-
memoizedSnapshot,
|
|
302
|
-
memoizedSelection,
|
|
303
|
-
maybeGetServerSnapshot =
|
|
304
|
-
void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
305
|
-
return [
|
|
306
|
-
function () {
|
|
307
|
-
return memoizedSelector(getSnapshot());
|
|
308
|
-
},
|
|
309
|
-
null === maybeGetServerSnapshot
|
|
310
|
-
? void 0
|
|
311
|
-
: function () {
|
|
312
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
313
|
-
}
|
|
314
|
-
];
|
|
315
|
-
},
|
|
316
|
-
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
317
|
-
);
|
|
318
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
319
|
-
useEffect(
|
|
320
|
-
function () {
|
|
321
|
-
inst.hasValue = true;
|
|
322
|
-
inst.value = value;
|
|
323
|
-
},
|
|
324
|
-
[value]
|
|
325
|
-
);
|
|
326
|
-
useDebugValue(value);
|
|
327
|
-
return value;
|
|
328
|
-
};
|
|
329
|
-
return withSelector_production;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
var withSelector_development = {};
|
|
58
|
+
((function () {
|
|
59
|
+
function is(x, y) {
|
|
60
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
61
|
+
}
|
|
62
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
63
|
+
didWarnOld18Alpha ||
|
|
64
|
+
void 0 === React$1.startTransition ||
|
|
65
|
+
((didWarnOld18Alpha = true),
|
|
66
|
+
console.error(
|
|
67
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
68
|
+
));
|
|
69
|
+
var value = getSnapshot();
|
|
70
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
71
|
+
var cachedValue = getSnapshot();
|
|
72
|
+
objectIs(value, cachedValue) ||
|
|
73
|
+
(console.error(
|
|
74
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
75
|
+
),
|
|
76
|
+
(didWarnUncachedGetSnapshot = true));
|
|
77
|
+
}
|
|
78
|
+
cachedValue = useState({
|
|
79
|
+
inst: { value: value, getSnapshot: getSnapshot }
|
|
80
|
+
});
|
|
81
|
+
var inst = cachedValue[0].inst,
|
|
82
|
+
forceUpdate = cachedValue[1];
|
|
83
|
+
useLayoutEffect(
|
|
84
|
+
function () {
|
|
85
|
+
inst.value = value;
|
|
86
|
+
inst.getSnapshot = getSnapshot;
|
|
87
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
88
|
+
},
|
|
89
|
+
[subscribe, value, getSnapshot]
|
|
90
|
+
);
|
|
91
|
+
useEffect(
|
|
92
|
+
function () {
|
|
93
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
94
|
+
return subscribe(function () {
|
|
95
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
96
|
+
});
|
|
97
|
+
},
|
|
98
|
+
[subscribe]
|
|
99
|
+
);
|
|
100
|
+
useDebugValue(value);
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
function checkIfSnapshotChanged(inst) {
|
|
104
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
105
|
+
inst = inst.value;
|
|
106
|
+
try {
|
|
107
|
+
var nextValue = latestGetSnapshot();
|
|
108
|
+
return !objectIs(inst, nextValue);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
114
|
+
return getSnapshot();
|
|
115
|
+
}
|
|
116
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
117
|
+
"function" ===
|
|
118
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
119
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
120
|
+
var React$1 = React,
|
|
121
|
+
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
122
|
+
useState = React$1.useState,
|
|
123
|
+
useEffect = React$1.useEffect,
|
|
124
|
+
useLayoutEffect = React$1.useLayoutEffect,
|
|
125
|
+
useDebugValue = React$1.useDebugValue,
|
|
126
|
+
didWarnOld18Alpha = false,
|
|
127
|
+
didWarnUncachedGetSnapshot = false,
|
|
128
|
+
shim =
|
|
129
|
+
"undefined" === typeof window ||
|
|
130
|
+
"undefined" === typeof window.document ||
|
|
131
|
+
"undefined" === typeof window.document.createElement
|
|
132
|
+
? useSyncExternalStore$1
|
|
133
|
+
: useSyncExternalStore$2;
|
|
134
|
+
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
135
|
+
void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
136
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
137
|
+
"function" ===
|
|
138
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
139
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
140
|
+
}))();
|
|
141
|
+
|
|
142
|
+
{
|
|
143
|
+
shim.exports = useSyncExternalStoreShim_development;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
var shimExports = shim.exports;
|
|
333
147
|
|
|
334
148
|
/**
|
|
335
149
|
* @license React
|
|
@@ -340,111 +154,100 @@ var withSelector_development = {};
|
|
|
340
154
|
* This source code is licensed under the MIT license found in the
|
|
341
155
|
* LICENSE file in the root directory of this source tree.
|
|
342
156
|
*/
|
|
157
|
+
((function () {
|
|
158
|
+
function is(x, y) {
|
|
159
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
160
|
+
}
|
|
161
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
162
|
+
"function" ===
|
|
163
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
164
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
165
|
+
var React$1 = React,
|
|
166
|
+
shim = shimExports,
|
|
167
|
+
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
168
|
+
useSyncExternalStore = shim.useSyncExternalStore,
|
|
169
|
+
useRef = React$1.useRef,
|
|
170
|
+
useEffect = React$1.useEffect,
|
|
171
|
+
useMemo = React$1.useMemo,
|
|
172
|
+
useDebugValue = React$1.useDebugValue;
|
|
173
|
+
withSelector_development.useSyncExternalStoreWithSelector = function (
|
|
174
|
+
subscribe,
|
|
175
|
+
getSnapshot,
|
|
176
|
+
getServerSnapshot,
|
|
177
|
+
selector,
|
|
178
|
+
isEqual
|
|
179
|
+
) {
|
|
180
|
+
var instRef = useRef(null);
|
|
181
|
+
if (null === instRef.current) {
|
|
182
|
+
var inst = { hasValue: false, value: null };
|
|
183
|
+
instRef.current = inst;
|
|
184
|
+
} else inst = instRef.current;
|
|
185
|
+
instRef = useMemo(
|
|
186
|
+
function () {
|
|
187
|
+
function memoizedSelector(nextSnapshot) {
|
|
188
|
+
if (!hasMemo) {
|
|
189
|
+
hasMemo = true;
|
|
190
|
+
memoizedSnapshot = nextSnapshot;
|
|
191
|
+
nextSnapshot = selector(nextSnapshot);
|
|
192
|
+
if (void 0 !== isEqual && inst.hasValue) {
|
|
193
|
+
var currentSelection = inst.value;
|
|
194
|
+
if (isEqual(currentSelection, nextSnapshot))
|
|
195
|
+
return (memoizedSelection = currentSelection);
|
|
196
|
+
}
|
|
197
|
+
return (memoizedSelection = nextSnapshot);
|
|
198
|
+
}
|
|
199
|
+
currentSelection = memoizedSelection;
|
|
200
|
+
if (objectIs(memoizedSnapshot, nextSnapshot))
|
|
201
|
+
return currentSelection;
|
|
202
|
+
var nextSelection = selector(nextSnapshot);
|
|
203
|
+
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
204
|
+
return (memoizedSnapshot = nextSnapshot), currentSelection;
|
|
205
|
+
memoizedSnapshot = nextSnapshot;
|
|
206
|
+
return (memoizedSelection = nextSelection);
|
|
207
|
+
}
|
|
208
|
+
var hasMemo = false,
|
|
209
|
+
memoizedSnapshot,
|
|
210
|
+
memoizedSelection,
|
|
211
|
+
maybeGetServerSnapshot =
|
|
212
|
+
void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
213
|
+
return [
|
|
214
|
+
function () {
|
|
215
|
+
return memoizedSelector(getSnapshot());
|
|
216
|
+
},
|
|
217
|
+
null === maybeGetServerSnapshot
|
|
218
|
+
? void 0
|
|
219
|
+
: function () {
|
|
220
|
+
return memoizedSelector(maybeGetServerSnapshot());
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
},
|
|
224
|
+
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
225
|
+
);
|
|
226
|
+
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
227
|
+
useEffect(
|
|
228
|
+
function () {
|
|
229
|
+
inst.hasValue = true;
|
|
230
|
+
inst.value = value;
|
|
231
|
+
},
|
|
232
|
+
[value]
|
|
233
|
+
);
|
|
234
|
+
useDebugValue(value);
|
|
235
|
+
return value;
|
|
236
|
+
};
|
|
237
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
238
|
+
"function" ===
|
|
239
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
240
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
241
|
+
}))();
|
|
343
242
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
function requireWithSelector_development () {
|
|
347
|
-
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
348
|
-
hasRequiredWithSelector_development = 1;
|
|
349
|
-
"production" !== process.env.NODE_ENV &&
|
|
350
|
-
(function () {
|
|
351
|
-
function is(x, y) {
|
|
352
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
353
|
-
}
|
|
354
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
355
|
-
"function" ===
|
|
356
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
357
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
358
|
-
var React = require$$0,
|
|
359
|
-
shim = requireShim(),
|
|
360
|
-
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
361
|
-
useSyncExternalStore = shim.useSyncExternalStore,
|
|
362
|
-
useRef = React.useRef,
|
|
363
|
-
useEffect = React.useEffect,
|
|
364
|
-
useMemo = React.useMemo,
|
|
365
|
-
useDebugValue = React.useDebugValue;
|
|
366
|
-
withSelector_development.useSyncExternalStoreWithSelector = function (
|
|
367
|
-
subscribe,
|
|
368
|
-
getSnapshot,
|
|
369
|
-
getServerSnapshot,
|
|
370
|
-
selector,
|
|
371
|
-
isEqual
|
|
372
|
-
) {
|
|
373
|
-
var instRef = useRef(null);
|
|
374
|
-
if (null === instRef.current) {
|
|
375
|
-
var inst = { hasValue: false, value: null };
|
|
376
|
-
instRef.current = inst;
|
|
377
|
-
} else inst = instRef.current;
|
|
378
|
-
instRef = useMemo(
|
|
379
|
-
function () {
|
|
380
|
-
function memoizedSelector(nextSnapshot) {
|
|
381
|
-
if (!hasMemo) {
|
|
382
|
-
hasMemo = true;
|
|
383
|
-
memoizedSnapshot = nextSnapshot;
|
|
384
|
-
nextSnapshot = selector(nextSnapshot);
|
|
385
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
386
|
-
var currentSelection = inst.value;
|
|
387
|
-
if (isEqual(currentSelection, nextSnapshot))
|
|
388
|
-
return (memoizedSelection = currentSelection);
|
|
389
|
-
}
|
|
390
|
-
return (memoizedSelection = nextSnapshot);
|
|
391
|
-
}
|
|
392
|
-
currentSelection = memoizedSelection;
|
|
393
|
-
if (objectIs(memoizedSnapshot, nextSnapshot))
|
|
394
|
-
return currentSelection;
|
|
395
|
-
var nextSelection = selector(nextSnapshot);
|
|
396
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
397
|
-
return (memoizedSnapshot = nextSnapshot), currentSelection;
|
|
398
|
-
memoizedSnapshot = nextSnapshot;
|
|
399
|
-
return (memoizedSelection = nextSelection);
|
|
400
|
-
}
|
|
401
|
-
var hasMemo = false,
|
|
402
|
-
memoizedSnapshot,
|
|
403
|
-
memoizedSelection,
|
|
404
|
-
maybeGetServerSnapshot =
|
|
405
|
-
void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
406
|
-
return [
|
|
407
|
-
function () {
|
|
408
|
-
return memoizedSelector(getSnapshot());
|
|
409
|
-
},
|
|
410
|
-
null === maybeGetServerSnapshot
|
|
411
|
-
? void 0
|
|
412
|
-
: function () {
|
|
413
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
414
|
-
}
|
|
415
|
-
];
|
|
416
|
-
},
|
|
417
|
-
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
418
|
-
);
|
|
419
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
420
|
-
useEffect(
|
|
421
|
-
function () {
|
|
422
|
-
inst.hasValue = true;
|
|
423
|
-
inst.value = value;
|
|
424
|
-
},
|
|
425
|
-
[value]
|
|
426
|
-
);
|
|
427
|
-
useDebugValue(value);
|
|
428
|
-
return value;
|
|
429
|
-
};
|
|
430
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
431
|
-
"function" ===
|
|
432
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
433
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
434
|
-
})();
|
|
435
|
-
return withSelector_development;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
if (process.env.NODE_ENV === 'production') {
|
|
439
|
-
withSelector.exports = requireWithSelector_production();
|
|
440
|
-
} else {
|
|
441
|
-
withSelector.exports = requireWithSelector_development();
|
|
243
|
+
{
|
|
244
|
+
withSelector.exports = withSelector_development;
|
|
442
245
|
}
|
|
443
246
|
|
|
444
247
|
var withSelectorExports = withSelector.exports;
|
|
445
248
|
var useSyncExternalStoreExports = /*@__PURE__*/getDefaultExportFromCjs(withSelectorExports);
|
|
446
249
|
|
|
447
|
-
const { useDebugValue } =
|
|
250
|
+
const { useDebugValue } = React;
|
|
448
251
|
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
449
252
|
let didWarnAboutEqualityFn = false;
|
|
450
253
|
const identity = (arg) => arg;
|
|
@@ -40472,8 +40275,8 @@ const VIEWPORT_PRESETS = [
|
|
|
40472
40275
|
];
|
|
40473
40276
|
const ViewportControls = () => {
|
|
40474
40277
|
const { viewportMode, setViewportMode, isOpen: isWidgetOpen } = useMarkupStore();
|
|
40475
|
-
const [isExpanded, setIsExpanded] =
|
|
40476
|
-
const dropdownRef =
|
|
40278
|
+
const [isExpanded, setIsExpanded] = React.useState(false);
|
|
40279
|
+
const dropdownRef = React.useRef(null);
|
|
40477
40280
|
const handlePresetClick = (preset) => {
|
|
40478
40281
|
setViewportMode({ width: preset.width, height: preset.height });
|
|
40479
40282
|
setIsExpanded(false);
|
|
@@ -40486,7 +40289,7 @@ const ViewportControls = () => {
|
|
|
40486
40289
|
return (viewportMode === null || viewportMode === void 0 ? void 0 : viewportMode.width) === preset.width && (viewportMode === null || viewportMode === void 0 ? void 0 : viewportMode.height) === preset.height;
|
|
40487
40290
|
};
|
|
40488
40291
|
// Close dropdown on outside click
|
|
40489
|
-
|
|
40292
|
+
React.useEffect(() => {
|
|
40490
40293
|
if (!isExpanded)
|
|
40491
40294
|
return;
|
|
40492
40295
|
const handleClickOutside = (event) => {
|
|
@@ -40498,7 +40301,7 @@ const ViewportControls = () => {
|
|
|
40498
40301
|
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
40499
40302
|
}, [isExpanded]);
|
|
40500
40303
|
// Handle ESC key to close dropdown or reset viewport
|
|
40501
|
-
|
|
40304
|
+
React.useEffect(() => {
|
|
40502
40305
|
const handleKeyDown = (event) => {
|
|
40503
40306
|
if (event.key === 'Escape') {
|
|
40504
40307
|
if (isExpanded) {
|