@valbuild/react 0.16.0 → 0.17.0

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.
Files changed (82) hide show
  1. package/dist/ValUI-3e00aae3.cjs.prod.js +104 -0
  2. package/dist/ValUI-64e3e5f2.browser.esm.js +102 -0
  3. package/dist/ValUI-9ac161d2.cjs.dev.js +104 -0
  4. package/dist/ValUI-d33998d0.esm.js +102 -0
  5. package/dist/declarations/src/ValProvider.d.ts +1 -1
  6. package/dist/declarations/src/ValStore.d.ts +8 -9
  7. package/dist/declarations/src/index.d.ts +1 -2
  8. package/dist/declarations/src/stega/index.d.ts +1 -3
  9. package/dist/declarations/src/stega/{stegaEncode.d.ts → transform.d.ts} +8 -5
  10. package/dist/{defineProperty-12b5bd29.esm.js → defineProperty-034d0378.browser.esm.js} +1 -1
  11. package/dist/{defineProperty-a4bf59bc.worker.esm.js → defineProperty-18559492.worker.esm.js} +1 -1
  12. package/dist/{defineProperty-f319cb47.browser.esm.js → defineProperty-b209a901.esm.js} +1 -1
  13. package/dist/{slicedToArray-d846e1d2.esm.js → slicedToArray-0cbb3d34.browser.esm.js} +13 -10
  14. package/dist/{slicedToArray-9e7d1407.worker.esm.js → slicedToArray-5a51fd33.worker.esm.js} +13 -10
  15. package/dist/{slicedToArray-b7cf26e0.cjs.dev.js → slicedToArray-5bddfa58.cjs.prod.js} +14 -11
  16. package/dist/slicedToArray-7b1713a7.cjs.dev.js +59 -0
  17. package/dist/{slicedToArray-1a246338.browser.esm.js → slicedToArray-b4fb91fa.esm.js} +13 -10
  18. package/dist/typeof-16c77f45.cjs.prod.js +13 -0
  19. package/dist/typeof-1de657a3.cjs.dev.js +13 -0
  20. package/dist/typeof-52fabea9.browser.esm.js +11 -0
  21. package/dist/typeof-5c86a240.esm.js +11 -0
  22. package/dist/typeof-8854ace1.worker.esm.js +11 -0
  23. package/dist/valbuild-react.browser.esm.js +618 -24
  24. package/dist/valbuild-react.cjs.dev.js +621 -28
  25. package/dist/valbuild-react.cjs.prod.js +621 -28
  26. package/dist/valbuild-react.esm.js +618 -24
  27. package/dist/valbuild-react.worker.esm.js +616 -24
  28. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.browser.esm.js +2 -2
  29. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.dev.js +3 -3
  30. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.cjs.prod.js +3 -3
  31. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.esm.js +2 -2
  32. package/jsx-dev-runtime/dist/valbuild-react-jsx-dev-runtime.worker.esm.js +2 -2
  33. package/jsx-runtime/dist/valbuild-react-jsx-runtime.browser.esm.js +2 -2
  34. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.dev.js +3 -3
  35. package/jsx-runtime/dist/valbuild-react-jsx-runtime.cjs.prod.js +3 -3
  36. package/jsx-runtime/dist/valbuild-react-jsx-runtime.esm.js +2 -2
  37. package/jsx-runtime/dist/valbuild-react-jsx-runtime.worker.esm.js +2 -2
  38. package/package.json +3 -3
  39. package/src/ValProvider.tsx +2 -3
  40. package/src/ValStore.ts +90 -40
  41. package/src/ValUI.tsx +49 -339
  42. package/src/index.ts +1 -2
  43. package/src/stega/autoTagJSX.ts +1 -1
  44. package/src/stega/index.ts +6 -3
  45. package/src/stega/transform.test.ts +145 -0
  46. package/src/stega/transform.ts +220 -0
  47. package/stega/dist/valbuild-react-stega.browser.esm.js +131 -46
  48. package/stega/dist/valbuild-react-stega.cjs.dev.js +134 -49
  49. package/stega/dist/valbuild-react-stega.cjs.prod.js +134 -49
  50. package/stega/dist/valbuild-react-stega.esm.js +131 -46
  51. package/stega/dist/valbuild-react-stega.worker.esm.js +109 -45
  52. package/dist/ValProvider-061ff397.cjs.dev.js +0 -715
  53. package/dist/ValProvider-b46efd66.browser.esm.js +0 -701
  54. package/dist/ValProvider-cb5a2161.worker.esm.js +0 -696
  55. package/dist/ValProvider-d7afb84b.cjs.js +0 -7
  56. package/dist/ValProvider-d7afb84b.cjs.prod.js +0 -715
  57. package/dist/ValProvider-fa35f7bd.esm.js +0 -701
  58. package/dist/ValUI-0bb9cc3d.cjs.prod.js +0 -383
  59. package/dist/ValUI-11cf8753.cjs.dev.js +0 -383
  60. package/dist/ValUI-13a58fa9.browser.esm.js +0 -381
  61. package/dist/ValUI-3d3b0d68.esm.js +0 -381
  62. package/dist/declarations/src/ValApi.d.ts +0 -12
  63. package/dist/declarations/src/hooks/useVal.d.ts +0 -3
  64. package/dist/declarations/src/stega/fetchVal.d.ts +0 -3
  65. package/dist/declarations/src/stega/hooks/useVal.d.ts +0 -3
  66. package/dist/objectSpread2-30cc2856.browser.esm.js +0 -25
  67. package/dist/objectSpread2-61fbd9a9.cjs.dev.js +0 -27
  68. package/dist/objectSpread2-7b752a35.cjs.prod.js +0 -27
  69. package/dist/objectSpread2-d5a1fe1c.esm.js +0 -25
  70. package/dist/slicedToArray-0eb0bcdb.cjs.prod.js +0 -56
  71. package/dist/unsupportedIterableToArray-51bb61c2.esm.js +0 -16
  72. package/dist/unsupportedIterableToArray-738344ef.worker.esm.js +0 -16
  73. package/dist/unsupportedIterableToArray-9e97e24a.cjs.dev.js +0 -18
  74. package/dist/unsupportedIterableToArray-afbea1dd.cjs.prod.js +0 -18
  75. package/dist/unsupportedIterableToArray-d3087ed5.browser.esm.js +0 -16
  76. package/src/AuthStatus.tsx +0 -13
  77. package/src/ValApi.ts +0 -65
  78. package/src/hooks/useVal.test.tsx +0 -57
  79. package/src/hooks/useVal.ts +0 -35
  80. package/src/stega/fetchVal.ts +0 -16
  81. package/src/stega/hooks/useVal.ts +0 -14
  82. package/src/stega/stegaEncode.ts +0 -84
@@ -1,381 +0,0 @@
1
- import { _ as _defineProperty } from './defineProperty-12b5bd29.esm.js';
2
- import { _ as _objectSpread2 } from './objectSpread2-d5a1fe1c.esm.js';
3
- import { _ as _slicedToArray, a as _typeof } from './slicedToArray-d846e1d2.esm.js';
4
- import { _ as _createForOfIteratorHelper, a as _asyncToGenerator, b as _regeneratorRuntime } from './ValProvider-fa35f7bd.esm.js';
5
- import { useRef, useState, useLayoutEffect, useEffect } from 'react';
6
- import { Style, ValOverlay } from '@valbuild/ui';
7
- import { FILE_REF_PROP, VAL_EXTENSION, Internal } from '@valbuild/core';
8
- import { createPortal } from 'react-dom';
9
- import { jsx, jsxs } from 'react/jsx-runtime';
10
- import './unsupportedIterableToArray-51bb61c2.esm.js';
11
-
12
- function ShadowContent(_ref) {
13
- var root = _ref.root,
14
- children = _ref.children;
15
- return /*#__PURE__*/createPortal(children, root);
16
- }
17
- var ShadowRoot = function ShadowRoot(_ref2) {
18
- var children = _ref2.children;
19
- var node = useRef(null);
20
- var _useState = useState(null),
21
- _useState2 = _slicedToArray(_useState, 2),
22
- root = _useState2[0],
23
- setRoot = _useState2[1];
24
- useLayoutEffect(function () {
25
- if (node.current) {
26
- if (node.current.shadowRoot) {
27
- setRoot(node.current.shadowRoot);
28
- } else {
29
- var _root = node.current.attachShadow({
30
- mode: "open"
31
- });
32
- setRoot(_root);
33
- }
34
- }
35
- }, []);
36
- return /*#__PURE__*/jsx("div", {
37
- ref: node,
38
- children: root && /*#__PURE__*/jsx(ShadowContent, {
39
- root: root,
40
- children: children
41
- })
42
- });
43
- };
44
-
45
- function ValUI(_ref) {
46
- var _ref3;
47
- var valApi = _ref.valApi,
48
- valStore = _ref.valStore;
49
- var _useState = useState([]),
50
- _useState2 = _slicedToArray(_useState, 2),
51
- selectedSources = _useState2[0],
52
- setSelectedSources = _useState2[1];
53
- var _useState3 = useState(false),
54
- _useState4 = _slicedToArray(_useState3, 2),
55
- editMode = _useState4[0],
56
- setEditMode = _useState4[1];
57
- var _useState5 = useState(null),
58
- _useState6 = _slicedToArray(_useState5, 2),
59
- editFormPosition = _useState6[0],
60
- setEditFormPosition = _useState6[1];
61
- var _useState7 = useState({
62
- status: "not-asked"
63
- }),
64
- _useState8 = _slicedToArray(_useState7, 2),
65
- authentication = _useState8[0],
66
- setAuthentication = _useState8[1];
67
- useEffect(function () {
68
- if (editMode) {
69
- valStore.updateAll();
70
- }
71
- }, [editMode]);
72
- useEffect(function () {
73
- var openValFormListener = undefined;
74
- var styleElement = undefined;
75
- var editButtonClickOptions = {
76
- capture: true,
77
- passive: true
78
- };
79
- if (editMode) {
80
- // highlight val element by appending a new style
81
- styleElement = document.createElement("style");
82
- styleElement.id = "val-edit-highlight";
83
- styleElement.innerHTML = "\n .val-edit-mode >* [data-val-path] {\n outline: #ffff00 solid 1px;\n cursor: pointer;\n }\n ";
84
- document.body.appendChild(styleElement);
85
-
86
- // capture event clicks on data-val-path elements
87
- openValFormListener = function openValFormListener(e) {
88
- if (e.target instanceof Element) {
89
- var _parent;
90
- var parent = e.target;
91
- while (parent && parent !== document.body) {
92
- if (parent.getAttribute("data-val-path")) {
93
- break;
94
- }
95
- if (parent.parentElement) {
96
- parent = parent.parentElement;
97
- } else {
98
- break;
99
- }
100
- }
101
- var valSources = (_parent = parent) === null || _parent === void 0 ? void 0 : _parent.getAttribute("data-val-path");
102
- if (valSources) {
103
- e.stopPropagation();
104
- setSelectedSources(valSources.split(",") /* TODO: just split on commas will not work if path contains , */);
105
-
106
- setEditFormPosition({
107
- left: e.pageX,
108
- top: e.pageY
109
- });
110
- // } else if (!isValElement(e.target)) {
111
- // console.log("click outside", e.target);
112
- // setEditFormPosition(null);
113
- // setSelectedSources([]);
114
- }
115
- }
116
- };
117
-
118
- document.addEventListener("click", openValFormListener, editButtonClickOptions);
119
- }
120
- return function () {
121
- var _styleElement;
122
- if (openValFormListener) {
123
- document.removeEventListener("click", openValFormListener, editButtonClickOptions);
124
- }
125
- (_styleElement = styleElement) === null || _styleElement === void 0 ? void 0 : _styleElement.remove();
126
- };
127
- }, [editMode]);
128
- useEffect(function () {
129
- if (editMode) {
130
- document.body.classList.add("val-edit-mode");
131
- } else {
132
- document.body.classList.remove("val-edit-mode");
133
- }
134
- if (editMode) {
135
- if (authentication.status !== "authenticated") {
136
- valApi.getSession().then( /*#__PURE__*/function () {
137
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
138
- var data, message;
139
- return _regeneratorRuntime().wrap(function _callee$(_context) {
140
- while (1) switch (_context.prev = _context.next) {
141
- case 0:
142
- if (!(res.status === 401)) {
143
- _context.next = 4;
144
- break;
145
- }
146
- setAuthentication({
147
- status: "unauthenticated"
148
- });
149
- _context.next = 21;
150
- break;
151
- case 4:
152
- if (!res.ok) {
153
- _context.next = 11;
154
- break;
155
- }
156
- _context.next = 7;
157
- return res.json();
158
- case 7:
159
- data = _context.sent;
160
- if (data.mode === "local") {
161
- setAuthentication({
162
- status: "local"
163
- });
164
- } else if (data.mode === "proxy") {
165
- setAuthentication({
166
- status: "authenticated"
167
- });
168
- } else {
169
- setAuthentication({
170
- status: "error",
171
- message: "Unknown authentication mode"
172
- });
173
- }
174
- _context.next = 21;
175
- break;
176
- case 11:
177
- message = "Unknown error";
178
- _context.prev = 12;
179
- _context.next = 15;
180
- return res.text();
181
- case 15:
182
- message = _context.sent;
183
- _context.next = 20;
184
- break;
185
- case 18:
186
- _context.prev = 18;
187
- _context.t0 = _context["catch"](12);
188
- case 20:
189
- setAuthentication({
190
- status: "error",
191
- message: message
192
- });
193
- case 21:
194
- case "end":
195
- return _context.stop();
196
- }
197
- }, _callee, null, [[12, 18]]);
198
- }));
199
- return function (_x) {
200
- return _ref2.apply(this, arguments);
201
- };
202
- }())["catch"](function (err) {
203
- console.error("Failed to fetch session", err);
204
- setAuthentication({
205
- status: "error",
206
- message: "Unknown authentication mode"
207
- });
208
- });
209
- }
210
- } else {
211
- if (authentication.status === "error") {
212
- setAuthentication({
213
- status: "not-asked"
214
- });
215
- }
216
- }
217
- }, [editMode, authentication.status]);
218
- var _useState9 = useState(false),
219
- _useState10 = _slicedToArray(_useState9, 2),
220
- showEditButton = _useState10[0],
221
- setShowEditButton = _useState10[1];
222
- useEffect(function () {
223
- setShowEditButton(true);
224
- }, []);
225
- var _useState11 = useState({}),
226
- _useState12 = _slicedToArray(_useState11, 2),
227
- inputs = _useState12[0],
228
- setInputs = _useState12[1];
229
- useEffect(function () {
230
- setInputs({});
231
- var _iterator = _createForOfIteratorHelper(selectedSources),
232
- _step;
233
- try {
234
- var _loop = function _loop() {
235
- var path = _step.value;
236
- valApi.getModule(path).then(function (serializedModule) {
237
- var input;
238
- if (serializedModule.schema.type === "string" && typeof serializedModule.source === "string") {
239
- input = {
240
- status: "completed",
241
- type: "text",
242
- data: serializedModule.source
243
- };
244
- } else if (serializedModule.schema.type === "richtext" && _typeof(serializedModule.source) === "object") {
245
- input = {
246
- status: "completed",
247
- type: "richtext",
248
- data: serializedModule.source // TODO: validate
249
- };
250
- } else if (serializedModule.schema.type === "image" && serializedModule.source && _typeof(serializedModule.source) === "object" && FILE_REF_PROP in serializedModule.source && typeof serializedModule.source[FILE_REF_PROP] === "string" && VAL_EXTENSION in serializedModule.source && typeof serializedModule.source[VAL_EXTENSION] === "string") {
251
- input = {
252
- status: "completed",
253
- type: "image",
254
- data: Internal.convertImageSource(serializedModule.source)
255
- };
256
- }
257
- console.log("input path", path);
258
- console.log("serialized path", serializedModule.path);
259
- if (!input) {
260
- throw new Error("Unsupported module type: ".concat(serializedModule.schema.type));
261
- }
262
- setInputs(function (inputs) {
263
- return _objectSpread2(_objectSpread2({}, inputs), {}, _defineProperty({}, serializedModule.path, input));
264
- });
265
- });
266
- };
267
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
268
- _loop();
269
- }
270
- } catch (err) {
271
- _iterator.e(err);
272
- } finally {
273
- _iterator.f();
274
- }
275
- }, [selectedSources.join(",")]);
276
- if (!showEditButton) {
277
- return null;
278
- }
279
- return /*#__PURE__*/jsxs(ShadowRoot, {
280
- children: [/*#__PURE__*/jsx("link", {
281
- rel: "preconnect",
282
- href: "https://fonts.googleapis.com"
283
- }), /*#__PURE__*/jsx("link", {
284
- rel: "preconnect",
285
- href: "https://fonts.gstatic.com",
286
- crossOrigin: "anonymous"
287
- }), /*#__PURE__*/jsx("link", {
288
- href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,400;1,700&display=swap",
289
- rel: "stylesheet"
290
- }), /*#__PURE__*/jsx(Style, {}), /*#__PURE__*/jsx("div", {
291
- "data-mode": "dark",
292
- children: /*#__PURE__*/jsx(ValOverlay, {
293
- editMode: editMode,
294
- setEditMode: setEditMode,
295
- closeValWindow: function closeValWindow() {
296
- setEditFormPosition(null);
297
- setSelectedSources([]);
298
- setInputs({});
299
- },
300
- valWindow: (_ref3 = editFormPosition && {
301
- position: editFormPosition,
302
- inputs: inputs,
303
- onSubmit: function onSubmit(inputs) {
304
- Promise.all(Object.entries(inputs).map(function (_ref4) {
305
- var _ref5 = _slicedToArray(_ref4, 2),
306
- path = _ref5[0],
307
- input = _ref5[1];
308
- if (input.status === "completed") {
309
- var _Internal$splitModule = Internal.splitModuleIdAndModulePath(path),
310
- _Internal$splitModule2 = _slicedToArray(_Internal$splitModule, 2),
311
- moduleId = _Internal$splitModule2[0],
312
- modulePath = _Internal$splitModule2[1];
313
- if (input.type === "text") {
314
- var patch = [{
315
- value: input.data,
316
- op: "replace",
317
- path: "/".concat(modulePath.split(".").map(function (p) {
318
- return JSON.parse(p);
319
- }).join("/"))
320
- }];
321
- return valApi.patchModuleContent(moduleId, patch);
322
- } else if (input.type === "image") {
323
- var pathParts = modulePath.split(".").map(function (p) {
324
- return JSON.parse(p);
325
- });
326
- if (!(input !== null && input !== void 0 && input.data) || !("src" in input.data)) {
327
- // TODO: We probably need to have an Output type that is different from the Input: we have a union of both cases in Input right now, and we believe we do not want that
328
- console.warn("No .src on input provided - this might mean no changes was made");
329
- return;
330
- }
331
- var _patch = [{
332
- value: input.data.src,
333
- op: "replace",
334
- path: "/".concat(pathParts.slice(0, -1).join("/"), "/$").concat(pathParts[pathParts.length - 1])
335
- }];
336
- if (input.data.metadata) {
337
- if (input.data.addMetadata) {
338
- _patch.push({
339
- value: input.data.metadata,
340
- op: "add",
341
- path: "/".concat(pathParts.join("/"), "/metadata")
342
- });
343
- } else {
344
- _patch.push({
345
- value: input.data.metadata,
346
- op: "replace",
347
- path: "/".concat(pathParts.join("/"), "/metadata")
348
- });
349
- }
350
- }
351
- console.log("patch", _patch);
352
- return valApi.patchModuleContent(moduleId, _patch);
353
- } else if (input.type === "richtext") {
354
- var _patch2 = [{
355
- value: input.data,
356
- op: "replace",
357
- path: "/".concat(modulePath.split(".").map(function (p) {
358
- return JSON.parse(p);
359
- }).join("/"))
360
- }];
361
- return valApi.patchModuleContent(moduleId, _patch2);
362
- }
363
- console.log("->", input);
364
- throw new Error("Unsupported input type: ".concat(input.type));
365
- } else {
366
- console.error("Submitted incomplete input, ignoring...");
367
- return Promise.resolve();
368
- }
369
- })).then(function () {
370
- setEditFormPosition(null);
371
- setSelectedSources([]);
372
- setInputs({});
373
- });
374
- }
375
- }) !== null && _ref3 !== void 0 ? _ref3 : undefined
376
- })
377
- })]
378
- });
379
- }
380
-
381
- export { ValUI as default };
@@ -1,12 +0,0 @@
1
- import { SerializedModule } from "@valbuild/core";
2
- import { PatchJSON } from "@valbuild/core/patch";
3
- export declare class ValApi {
4
- readonly host: string;
5
- constructor(host: string);
6
- getModule(sourcePath: string): Promise<SerializedModule>;
7
- patchModuleContent(moduleId: string, patch: PatchJSON): Promise<SerializedModule>;
8
- commit(): Promise<void>;
9
- getSession(): Promise<Response>;
10
- loginUrl(): string;
11
- logout(): Promise<Response>;
12
- }
@@ -1,3 +0,0 @@
1
- import { SelectorSource, SelectorOf, GenericSelector, Val } from "@valbuild/core";
2
- import { JsonOfSource } from "@valbuild/core/src/val";
3
- export declare function useVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? Val<JsonOfSource<S>> : never;
@@ -1,3 +0,0 @@
1
- import { SelectorSource, SelectorOf, GenericSelector } from "@valbuild/core";
2
- import { StegaOfSource } from "./stegaEncode.js";
3
- export declare function fetchVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? Promise<StegaOfSource<S>> : never;
@@ -1,3 +0,0 @@
1
- import { GenericSelector, SelectorOf, SelectorSource } from "@valbuild/core";
2
- import { StegaOfSource } from "../stegaEncode.js";
3
- export declare function useVal<T extends SelectorSource>(selector: T, locale?: string): SelectorOf<T> extends GenericSelector<infer S> ? StegaOfSource<S> : never;
@@ -1,25 +0,0 @@
1
- import { _ as _defineProperty } from './defineProperty-f319cb47.browser.esm.js';
2
-
3
- function ownKeys(object, enumerableOnly) {
4
- var keys = Object.keys(object);
5
- if (Object.getOwnPropertySymbols) {
6
- var symbols = Object.getOwnPropertySymbols(object);
7
- enumerableOnly && (symbols = symbols.filter(function (sym) {
8
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
9
- })), keys.push.apply(keys, symbols);
10
- }
11
- return keys;
12
- }
13
- function _objectSpread2(target) {
14
- for (var i = 1; i < arguments.length; i++) {
15
- var source = null != arguments[i] ? arguments[i] : {};
16
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
17
- _defineProperty(target, key, source[key]);
18
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
19
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
20
- });
21
- }
22
- return target;
23
- }
24
-
25
- export { _objectSpread2 as _ };
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var defineProperty = require('./defineProperty-c82a49b0.cjs.dev.js');
4
-
5
- function ownKeys(object, enumerableOnly) {
6
- var keys = Object.keys(object);
7
- if (Object.getOwnPropertySymbols) {
8
- var symbols = Object.getOwnPropertySymbols(object);
9
- enumerableOnly && (symbols = symbols.filter(function (sym) {
10
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11
- })), keys.push.apply(keys, symbols);
12
- }
13
- return keys;
14
- }
15
- function _objectSpread2(target) {
16
- for (var i = 1; i < arguments.length; i++) {
17
- var source = null != arguments[i] ? arguments[i] : {};
18
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
19
- defineProperty._defineProperty(target, key, source[key]);
20
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
21
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
22
- });
23
- }
24
- return target;
25
- }
26
-
27
- exports._objectSpread2 = _objectSpread2;
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var defineProperty = require('./defineProperty-36ed93cd.cjs.prod.js');
4
-
5
- function ownKeys(object, enumerableOnly) {
6
- var keys = Object.keys(object);
7
- if (Object.getOwnPropertySymbols) {
8
- var symbols = Object.getOwnPropertySymbols(object);
9
- enumerableOnly && (symbols = symbols.filter(function (sym) {
10
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11
- })), keys.push.apply(keys, symbols);
12
- }
13
- return keys;
14
- }
15
- function _objectSpread2(target) {
16
- for (var i = 1; i < arguments.length; i++) {
17
- var source = null != arguments[i] ? arguments[i] : {};
18
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
19
- defineProperty._defineProperty(target, key, source[key]);
20
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
21
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
22
- });
23
- }
24
- return target;
25
- }
26
-
27
- exports._objectSpread2 = _objectSpread2;
@@ -1,25 +0,0 @@
1
- import { _ as _defineProperty } from './defineProperty-12b5bd29.esm.js';
2
-
3
- function ownKeys(object, enumerableOnly) {
4
- var keys = Object.keys(object);
5
- if (Object.getOwnPropertySymbols) {
6
- var symbols = Object.getOwnPropertySymbols(object);
7
- enumerableOnly && (symbols = symbols.filter(function (sym) {
8
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
9
- })), keys.push.apply(keys, symbols);
10
- }
11
- return keys;
12
- }
13
- function _objectSpread2(target) {
14
- for (var i = 1; i < arguments.length; i++) {
15
- var source = null != arguments[i] ? arguments[i] : {};
16
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
17
- _defineProperty(target, key, source[key]);
18
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
19
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
20
- });
21
- }
22
- return target;
23
- }
24
-
25
- export { _objectSpread2 as _ };
@@ -1,56 +0,0 @@
1
- 'use strict';
2
-
3
- var unsupportedIterableToArray = require('./unsupportedIterableToArray-afbea1dd.cjs.prod.js');
4
-
5
- function _typeof(obj) {
6
- "@babel/helpers - typeof";
7
-
8
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
9
- return typeof obj;
10
- } : function (obj) {
11
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
12
- }, _typeof(obj);
13
- }
14
-
15
- function _arrayWithHoles(arr) {
16
- if (Array.isArray(arr)) return arr;
17
- }
18
-
19
- function _iterableToArrayLimit(arr, i) {
20
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
21
- if (null != _i) {
22
- var _s,
23
- _e,
24
- _x,
25
- _r,
26
- _arr = [],
27
- _n = !0,
28
- _d = !1;
29
- try {
30
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
31
- if (Object(_i) !== _i) return;
32
- _n = !1;
33
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
34
- } catch (err) {
35
- _d = !0, _e = err;
36
- } finally {
37
- try {
38
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
39
- } finally {
40
- if (_d) throw _e;
41
- }
42
- }
43
- return _arr;
44
- }
45
- }
46
-
47
- function _nonIterableRest() {
48
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
49
- }
50
-
51
- function _slicedToArray(arr, i) {
52
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || unsupportedIterableToArray._unsupportedIterableToArray(arr, i) || _nonIterableRest();
53
- }
54
-
55
- exports._slicedToArray = _slicedToArray;
56
- exports._typeof = _typeof;
@@ -1,16 +0,0 @@
1
- function _arrayLikeToArray(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4
- return arr2;
5
- }
6
-
7
- function _unsupportedIterableToArray(o, minLen) {
8
- if (!o) return;
9
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
10
- var n = Object.prototype.toString.call(o).slice(8, -1);
11
- if (n === "Object" && o.constructor) n = o.constructor.name;
12
- if (n === "Map" || n === "Set") return Array.from(o);
13
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
14
- }
15
-
16
- export { _unsupportedIterableToArray as _ };
@@ -1,16 +0,0 @@
1
- function _arrayLikeToArray(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4
- return arr2;
5
- }
6
-
7
- function _unsupportedIterableToArray(o, minLen) {
8
- if (!o) return;
9
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
10
- var n = Object.prototype.toString.call(o).slice(8, -1);
11
- if (n === "Object" && o.constructor) n = o.constructor.name;
12
- if (n === "Map" || n === "Set") return Array.from(o);
13
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
14
- }
15
-
16
- export { _unsupportedIterableToArray as _ };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- function _arrayLikeToArray(arr, len) {
4
- if (len == null || len > arr.length) len = arr.length;
5
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
6
- return arr2;
7
- }
8
-
9
- function _unsupportedIterableToArray(o, minLen) {
10
- if (!o) return;
11
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
12
- var n = Object.prototype.toString.call(o).slice(8, -1);
13
- if (n === "Object" && o.constructor) n = o.constructor.name;
14
- if (n === "Map" || n === "Set") return Array.from(o);
15
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
16
- }
17
-
18
- exports._unsupportedIterableToArray = _unsupportedIterableToArray;
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- function _arrayLikeToArray(arr, len) {
4
- if (len == null || len > arr.length) len = arr.length;
5
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
6
- return arr2;
7
- }
8
-
9
- function _unsupportedIterableToArray(o, minLen) {
10
- if (!o) return;
11
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
12
- var n = Object.prototype.toString.call(o).slice(8, -1);
13
- if (n === "Object" && o.constructor) n = o.constructor.name;
14
- if (n === "Map" || n === "Set") return Array.from(o);
15
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
16
- }
17
-
18
- exports._unsupportedIterableToArray = _unsupportedIterableToArray;
@@ -1,16 +0,0 @@
1
- function _arrayLikeToArray(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4
- return arr2;
5
- }
6
-
7
- function _unsupportedIterableToArray(o, minLen) {
8
- if (!o) return;
9
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
10
- var n = Object.prototype.toString.call(o).slice(8, -1);
11
- if (n === "Object" && o.constructor) n = o.constructor.name;
12
- if (n === "Map" || n === "Set") return Array.from(o);
13
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
14
- }
15
-
16
- export { _unsupportedIterableToArray as _ };
@@ -1,13 +0,0 @@
1
- export type AuthStatus =
2
- | {
3
- status:
4
- | "not-asked"
5
- | "authenticated"
6
- | "unauthenticated"
7
- | "loading"
8
- | "local";
9
- }
10
- | {
11
- status: "error";
12
- message: string;
13
- };