@plasmicapp/host 1.0.149 → 1.0.150
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/exports.d.ts +1 -1
- package/dist/host.esm.js +8 -2
- package/dist/host.esm.js.map +1 -1
- package/dist/index.cjs.js +8 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/prop-types.d.ts +8 -4
- package/dist/registerComponent.d.ts +5 -0
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
- package/registerComponent/dist/exports.d.ts +1 -1
- package/registerComponent/dist/index.cjs.js +6 -0
- package/registerComponent/dist/index.cjs.js.map +1 -1
- package/registerComponent/dist/index.esm.js +6 -1
- package/registerComponent/dist/index.esm.js.map +1 -1
- package/registerComponent/dist/prop-types.d.ts +8 -4
- package/registerComponent/dist/registerComponent.d.ts +5 -0
- package/registerComponent/dist/version.d.ts +1 -1
- package/registerGlobalContext/dist/exports.d.ts +1 -1
- package/registerGlobalContext/dist/prop-types.d.ts +8 -4
- package/registerGlobalContext/dist/registerComponent.d.ts +5 -0
- package/registerGlobalContext/dist/version.d.ts +1 -1
- package/registerToken/dist/exports.d.ts +1 -1
- package/registerToken/dist/prop-types.d.ts +8 -4
- package/registerToken/dist/registerComponent.d.ts +5 -0
- package/registerToken/dist/version.d.ts +1 -1
- package/registerTrait/dist/exports.d.ts +1 -1
- package/registerTrait/dist/prop-types.d.ts +8 -4
- package/registerTrait/dist/registerComponent.d.ts +5 -0
- package/registerTrait/dist/version.d.ts +1 -1
package/dist/exports.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
package/dist/host.esm.js
CHANGED
|
@@ -371,6 +371,11 @@ function useGlobalActions() {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
var root$5 = globalThis;
|
|
374
|
+
var stateHelpersKeys = [
|
|
375
|
+
"initFunc",
|
|
376
|
+
"onChangeArgsToValue",
|
|
377
|
+
"onMutate",
|
|
378
|
+
];
|
|
374
379
|
if (root$5.__PlasmicComponentRegistry == null) {
|
|
375
380
|
root$5.__PlasmicComponentRegistry = [];
|
|
376
381
|
}
|
|
@@ -463,6 +468,7 @@ var hostModule = /*#__PURE__*/Object.freeze({
|
|
|
463
468
|
usePlasmicCanvasContext: usePlasmicCanvasContext,
|
|
464
469
|
unstable_registerFetcher: registerFetcher,
|
|
465
470
|
registerComponent: registerComponent,
|
|
471
|
+
stateHelpersKeys: stateHelpersKeys,
|
|
466
472
|
registerGlobalContext: registerGlobalContext,
|
|
467
473
|
registerToken: registerToken,
|
|
468
474
|
registerTrait: registerTrait,
|
|
@@ -485,7 +491,7 @@ var hostModule = /*#__PURE__*/Object.freeze({
|
|
|
485
491
|
PlasmicLinkProvider: PlasmicLinkProvider
|
|
486
492
|
});
|
|
487
493
|
|
|
488
|
-
var hostVersion = "1.0.
|
|
494
|
+
var hostVersion = "1.0.150";
|
|
489
495
|
|
|
490
496
|
var root = globalThis;
|
|
491
497
|
if (root.__Sub == null) {
|
|
@@ -503,5 +509,5 @@ if (root.__Sub == null) {
|
|
|
503
509
|
setPlasmicRootNode: setPlasmicRootNode, registerRenderErrorListener: registerRenderErrorListener, setRepeatedElementFn: setRepeatedElementFn }, hostModule);
|
|
504
510
|
}
|
|
505
511
|
|
|
506
|
-
export { DataContext, DataCtxReader, DataProvider, GlobalActionsContext, GlobalActionsProvider, PageParamsProvider, PlasmicCanvasContext, PlasmicCanvasHost, PlasmicLinkProvider, applySelector, mkMetaName, mkMetaValue, registerComponent, registerGlobalContext, registerToken, registerTrait, repeatedElement, registerFetcher as unstable_registerFetcher, useDataEnv, useGlobalActions, usePlasmicCanvasContext, usePlasmicLink, usePlasmicLinkMaybe, useSelector, useSelectors };
|
|
512
|
+
export { DataContext, DataCtxReader, DataProvider, GlobalActionsContext, GlobalActionsProvider, PageParamsProvider, PlasmicCanvasContext, PlasmicCanvasHost, PlasmicLinkProvider, applySelector, mkMetaName, mkMetaValue, registerComponent, registerGlobalContext, registerToken, registerTrait, repeatedElement, stateHelpersKeys, registerFetcher as unstable_registerFetcher, useDataEnv, useGlobalActions, usePlasmicCanvasContext, usePlasmicLink, usePlasmicLinkMaybe, useSelector, useSelectors };
|
|
507
513
|
//# sourceMappingURL=host.esm.js.map
|
package/dist/host.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.esm.js","sources":["../../../node_modules/tslib/tslib.es6.js","../src/lang-utils.ts","../src/useForceUpdate.ts","../src/canvas-host.tsx","../src/common.ts","../src/data.tsx","../src/fetcher.ts","../src/global-actions.tsx","../src/registerComponent.ts","../src/registerGlobalContext.ts","../src/registerToken.ts","../src/registerTrait.ts","../src/repeatedElement.ts","../src/link.tsx","../src/version.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function isString(x: any): x is string {\n return typeof x === \"string\";\n}\n\ntype StringGen = string | (() => string);\n\nexport function ensure<T>(x: T | null | undefined, msg: StringGen = \"\"): T {\n if (x === null || x === undefined) {\n debugger;\n msg = (isString(msg) ? msg : msg()) || \"\";\n throw new Error(\n `Value must not be undefined or null${msg ? `- ${msg}` : \"\"}`\n );\n } else {\n return x;\n }\n}\n","import { useCallback, useState } from \"react\";\n\nexport default function useForceUpdate() {\n const [, setTick] = useState(0);\n const update = useCallback(() => {\n setTick((tick) => tick + 1);\n }, []);\n return update;\n}\n","import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { ensure } from \"./lang-utils\";\nimport useForceUpdate from \"./useForceUpdate\";\n\ndeclare global {\n interface Window {\n __PlasmicHostVersion: string;\n }\n}\n\nif ((globalThis as any).__PlasmicHostVersion == null) {\n (globalThis as any).__PlasmicHostVersion = \"3\";\n}\n\nconst rootChangeListeners: (() => void)[] = [];\nclass PlasmicRootNodeWrapper {\n constructor(private value: null | React.ReactElement) {}\n set = (val: null | React.ReactElement) => {\n this.value = val;\n rootChangeListeners.forEach((f) => f());\n };\n get = () => this.value;\n}\n\nconst plasmicRootNode = new PlasmicRootNodeWrapper(null);\n\nfunction getHashParams() {\n return new URLSearchParams(location.hash.replace(/^#/, \"?\"));\n}\n\nfunction getPlasmicOrigin() {\n const params = getHashParams();\n return ensure(\n params.get(\"origin\"),\n \"Missing information from Plasmic window.\"\n );\n}\n\nfunction getStudioHash() {\n const hashParams = getHashParams();\n if (hashParams.has(\"studioHash\")) {\n return hashParams.get(\"studioHash\");\n }\n const urlParams = new URL(location.href).searchParams;\n return urlParams.get(\"studio-hash\");\n}\n\nfunction renderStudioIntoIframe() {\n const script = document.createElement(\"script\");\n const plasmicOrigin = getPlasmicOrigin();\n const hash = getStudioHash();\n script.src = `${plasmicOrigin}/static/js/studio${\n hash ? `.${hash}.js` : `.js`\n }`;\n document.body.appendChild(script);\n}\n\nlet renderCount = 0;\nexport function setPlasmicRootNode(node: React.ReactElement | null) {\n // Keep track of renderCount, which we use as key to ErrorBoundary, so\n // we can reset the error on each render\n renderCount++;\n plasmicRootNode.set(node);\n}\n\nexport interface PlasmicCanvasContextValue {\n componentName: string | null;\n globalVariants: Record<string, string>;\n interactive?: boolean;\n}\n\n/**\n * React context to detect whether the component is rendered on Plasmic editor.\n * If not, return false.\n * If so, return an object with more information about the component\n */\nexport const PlasmicCanvasContext = React.createContext<\n PlasmicCanvasContextValue | false\n>(false);\nexport const usePlasmicCanvasContext = () =>\n React.useContext(PlasmicCanvasContext);\n\nfunction _PlasmicCanvasHost() {\n // If window.parent is null, then this is a window whose containing iframe\n // has been detached from the DOM (for the top window, window.parent === window).\n // In that case, we shouldn't do anything. If window.parent is null, by the way,\n // location.hash will also be null.\n const isFrameAttached = !!window.parent;\n const isCanvas = !!location.hash?.match(/\\bcanvas=true\\b/);\n const isLive = !!location.hash?.match(/\\blive=true\\b/) || !isFrameAttached;\n const shouldRenderStudio =\n isFrameAttached &&\n !document.querySelector(\"#plasmic-studio-tag\") &&\n !isCanvas &&\n !isLive;\n const forceUpdate = useForceUpdate();\n React.useLayoutEffect(() => {\n rootChangeListeners.push(forceUpdate);\n return () => {\n const index = rootChangeListeners.indexOf(forceUpdate);\n if (index >= 0) {\n rootChangeListeners.splice(index, 1);\n }\n };\n }, [forceUpdate]);\n React.useEffect(() => {\n if (shouldRenderStudio && isFrameAttached && window.parent !== window) {\n renderStudioIntoIframe();\n }\n }, [shouldRenderStudio, isFrameAttached]);\n React.useEffect(() => {\n if (!shouldRenderStudio && !document.querySelector(\"#getlibs\") && isLive) {\n const scriptElt = document.createElement(\"script\");\n scriptElt.id = \"getlibs\";\n scriptElt.src = getPlasmicOrigin() + \"/static/js/getlibs.js\";\n scriptElt.async = false;\n scriptElt.onload = () => {\n (window as any).__GetlibsReadyResolver?.();\n };\n document.head.append(scriptElt);\n }\n }, [shouldRenderStudio]);\n\n const [canvasContextValue, setCanvasContextValue] = React.useState(() =>\n deriveCanvasContextValue()\n );\n\n React.useEffect(() => {\n if (isCanvas) {\n const listener = () => {\n setCanvasContextValue(deriveCanvasContextValue());\n };\n window.addEventListener(\"hashchange\", listener);\n return () => window.removeEventListener(\"hashchange\", listener);\n }\n return undefined;\n }, [isCanvas]);\n if (!isFrameAttached) {\n return null;\n }\n if (isCanvas || isLive) {\n let appDiv = document.querySelector(\"#plasmic-app.__wab_user-body\");\n if (!appDiv) {\n appDiv = document.createElement(\"div\");\n appDiv.id = \"plasmic-app\";\n appDiv.classList.add(\"__wab_user-body\");\n document.body.appendChild(appDiv);\n }\n return ReactDOM.createPortal(\n <ErrorBoundary key={`${renderCount}`}>\n <PlasmicCanvasContext.Provider value={canvasContextValue}>\n {plasmicRootNode.get()}\n </PlasmicCanvasContext.Provider>\n </ErrorBoundary>,\n appDiv,\n \"plasmic-app\"\n );\n }\n if (shouldRenderStudio && window.parent === window) {\n return (\n <iframe\n src={`https://docs.plasmic.app/app-content/app-host-ready#appHostUrl=${encodeURIComponent(\n location.href\n )}`}\n style={{\n width: \"100vw\",\n height: \"100vh\",\n border: \"none\",\n position: \"fixed\",\n top: 0,\n left: 0,\n zIndex: 99999999,\n }}\n ></iframe>\n );\n }\n return null;\n}\n\ninterface PlasmicCanvasHostProps {\n /**\n * Webpack hmr uses EventSource to\tlisten to hot reloads, but that\n * resultsin a persistent\tconnection from\teach window. In Plasmic\n * Studio, if a project is configured to use app-hosting with a\n * nextjs or gatsby server running in dev mode, each artboard will\n * be holding a persistent connection to the dev server.\n * Because browsers\thave a limit to\thow many connections can\n * be held\tat a time by domain, this means\tafter X\tartboards, new\n * artboards will freeze and not load.\n *\n * By default, <PlasmicCanvasHost /> will globally mutate\n * window.EventSource to avoid using EventSource for HMR, which you\n * typically don't need for your custom host page. If you do still\n * want to retain HRM, then youc an pass enableWebpackHmr={true}.\n */\n enableWebpackHmr?: boolean;\n}\n\nexport const PlasmicCanvasHost: React.FunctionComponent<\n PlasmicCanvasHostProps\n> = (props) => {\n const { enableWebpackHmr } = props;\n const [node, setNode] = React.useState<React.ReactElement<any, any> | null>(\n null\n );\n React.useEffect(() => {\n setNode(<_PlasmicCanvasHost />);\n }, []);\n return (\n <>\n {!enableWebpackHmr && <DisableWebpackHmr />}\n {node}\n </>\n );\n};\n\ntype RenderErrorListener = (err: Error) => void;\nconst renderErrorListeners: RenderErrorListener[] = [];\nexport function registerRenderErrorListener(listener: RenderErrorListener) {\n renderErrorListeners.push(listener);\n return () => {\n const index = renderErrorListeners.indexOf(listener);\n if (index >= 0) {\n renderErrorListeners.splice(index, 1);\n }\n };\n}\n\ninterface ErrorBoundaryProps {\n children?: React.ReactNode;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nclass ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {};\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error) {\n renderErrorListeners.forEach((listener) => listener(error));\n }\n\n render() {\n if (this.state.error) {\n return <div>Error: {`${this.state.error.message}`}</div>;\n } else {\n return <>{this.props.children}</>;\n }\n }\n}\n\nfunction DisableWebpackHmr() {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n return (\n <script\n type=\"text/javascript\"\n dangerouslySetInnerHTML={{\n __html: `\n if (typeof window !== \"undefined\") {\n const RealEventSource = window.EventSource;\n window.EventSource = function(url, config) {\n if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {\n console.warn(\"Plasmic: disabled EventSource request for\", url);\n return {\n onerror() {}, onmessage() {}, onopen() {}, close() {}\n };\n } else {\n return new RealEventSource(url, config);\n }\n }\n }\n `,\n }}\n ></script>\n );\n}\n\nfunction deriveCanvasContextValue(): PlasmicCanvasContextValue | false {\n const hash = window.location.hash;\n if (hash && hash.length > 0) {\n // create URLsearchParams skipping the initial # character\n const params = new URLSearchParams(hash.substring(1));\n if (params.get(\"canvas\") === \"true\") {\n const globalVariants = params.get(\"globalVariants\");\n return {\n componentName: params.get(\"componentName\") ?? null,\n globalVariants: globalVariants ? JSON.parse(globalVariants) : {},\n interactive: params.get(\"interactive\") === \"true\",\n };\n }\n }\n return false;\n}\n","export const tuple = <T extends any[]>(...args: T): T => args;\n","import React, {\n createContext,\n ReactElement,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport type DataMeta = {\n hidden?: boolean;\n label?: string;\n};\n\nexport function mkMetaName(name: string) {\n return `__plasmic_meta_${name}`;\n}\n\nexport function mkMetaValue(meta: Partial<DataMeta>): DataMeta {\n return meta;\n}\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n /**\n * Key to set in data context.\n */\n name?: string;\n /**\n * Value to set for `name` in data context.\n */\n data?: any;\n /**\n * If true, hide this entry in studio (data binding).\n */\n hidden?: boolean;\n /**\n * Label to be shown in the studio data picker for easier navigation (data binding).\n */\n label?: string;\n children?: ReactNode;\n}\n\nexport function DataProvider({\n name,\n data,\n hidden,\n label,\n children,\n}: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider\n value={{\n ...existingEnv,\n [name]: data,\n [mkMetaName(name)]: mkMetaValue({ hidden, label }),\n }}\n >\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface PageParamsProviderProps {\n params?: Record<string, string | string[] | undefined>;\n query?: Record<string, string | string[] | undefined>;\n children?: ReactNode;\n}\n\nexport function PageParamsProvider({\n children,\n params = {},\n query = {},\n}: PageParamsProviderProps) {\n const $ctx = useDataEnv() || {};\n return (\n <DataProvider\n name={\"params\"}\n data={{ ...$ctx.params, ...params }}\n label={\"Page URL path params\"}\n >\n <DataProvider\n name={\"query\"}\n data={{ ...$ctx.query, ...query }}\n label={\"Page URL query params\"}\n >\n {children}\n </DataProvider>\n </DataProvider>\n );\n}\n\nexport function DataCtxReader({\n children,\n}: {\n children: ($ctx: DataDict | undefined) => ReactNode;\n}) {\n const $ctx = useDataEnv();\n return children($ctx) as ReactElement | null;\n}\n","import { PrimitiveType } from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport type Fetcher = (...args: any[]) => Promise<any>;\n\nexport interface FetcherMeta {\n /**\n * Any unique identifying string for this fetcher.\n */\n name: string;\n /**\n * The Studio-user-friendly display name.\n */\n displayName?: string;\n /**\n * The symbol to import from the importPath.\n */\n importName?: string;\n args: { name: string; type: PrimitiveType }[];\n returns: PrimitiveType;\n /**\n * Either the path to the fetcher relative to `rootDir` or the npm\n * package name\n */\n importPath: string;\n /**\n * Whether it's a default export or named export\n */\n isDefaultExport?: boolean;\n}\n\nexport interface FetcherRegistration {\n fetcher: Fetcher;\n meta: FetcherMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicFetcherRegistry: FetcherRegistration[];\n }\n}\n\nroot.__PlasmicFetcherRegistry = [];\n\nexport function registerFetcher(fetcher: Fetcher, meta: FetcherMeta) {\n root.__PlasmicFetcherRegistry.push({ fetcher, meta });\n}\n","import React from \"react\";\n\nexport type GlobalActionDict = Record<string, Function>;\n\nexport const GlobalActionsContext = React.createContext<\n GlobalActionDict | undefined\n>(undefined);\n\nexport function GlobalActionsProvider(props: {\n contextName: string;\n children?: React.ReactNode;\n actions: GlobalActionDict;\n}) {\n const { contextName, children, actions } = props;\n const namespacedActions = React.useMemo(\n () =>\n Object.fromEntries(\n Object.entries(actions).map(([key, val]) => [\n `${contextName}.${key}`,\n val,\n ])\n ),\n [contextName, actions]\n );\n return (\n <GlobalActionsContext.Provider value={namespacedActions}>\n {children}\n </GlobalActionsContext.Provider>\n );\n}\n\nexport function useGlobalActions() {\n return React.useContext(GlobalActionsContext) ?? {};\n}\n","import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n}\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n","import {\n BooleanType,\n ChoiceType,\n CustomType,\n JSONLikeType,\n NumberType,\n StringType,\n DataSourceType,\n} from \"./prop-types\";\nimport { FunctionParam } from \"./registerComponent\";\n\nconst root = globalThis as any;\n\n// Using just a subset of types from prop-types\nexport type PropType<P> =\n | StringType<P>\n | BooleanType<P>\n | NumberType<P>\n | JSONLikeType<P>\n | ChoiceType<P>\n | CustomType<P>\n | DataSourceType<P>;\n\ntype RestrictPropType<T, P> = T extends string\n ? StringType<P> | ChoiceType<P> | JSONLikeType<P> | CustomType<P>\n : T extends boolean\n ? BooleanType<P> | JSONLikeType<P> | CustomType<P>\n : T extends number\n ? NumberType<P> | JSONLikeType<P> | CustomType<P>\n : PropType<P>;\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\nexport interface GlobalContextMeta<P> {\n /**\n * Any unique string name used to identify that context. Each context\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the context in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the context to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the context properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * The path to be used when importing the context in the generated code.\n * It can be the name of the package that contains the context, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the context is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Whether the global context provides data to its children using DataProvider.\n */\n providesData?: boolean;\n\n unstable__globalActions?: Record<string, GlobalActionRegistration<P>>;\n}\n\nexport interface GlobalContextRegistration {\n component: React.ComponentType<any>;\n meta: GlobalContextMeta<any>;\n}\n\nexport interface GlobalActionRegistration<P> {\n displayName?: string;\n description?: string;\n parameters: FunctionParam<P>[];\n}\n\ndeclare global {\n interface Window {\n __PlasmicContextRegistry: GlobalContextRegistration[];\n }\n}\n\nif (root.__PlasmicContextRegistry == null) {\n root.__PlasmicContextRegistry = [];\n}\n\nexport default function registerGlobalContext<\n T extends React.ComponentType<any>\n>(component: T, meta: GlobalContextMeta<React.ComponentProps<T>>) {\n // Check for duplicates\n if (\n root.__PlasmicContextRegistry.some(\n (r: GlobalContextRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicContextRegistry.push({ component, meta });\n}\n","export type TokenType =\n | \"color\"\n | \"spacing\"\n | \"font-family\"\n | \"font-size\"\n | \"line-height\"\n | \"opacity\";\n\nexport interface TokenRegistration {\n name: string;\n displayName: string;\n value: string;\n type: TokenType;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTokenRegistry: TokenRegistration[];\n }\n}\n\nconst root = globalThis as any;\n\nif (root.__PlasmicTokenRegistry == null) {\n root.__PlasmicTokenRegistry = [];\n}\n\nexport default function registerToken(token: TokenRegistration) {\n root.__PlasmicTokenRegistry.push(token);\n}\n","const root = globalThis as any;\n\nexport interface BasicTrait {\n label?: string;\n type: \"text\" | \"number\" | \"boolean\";\n}\n\nexport interface ChoiceTrait {\n label?: string;\n type: \"choice\";\n options: string[];\n}\n\nexport type TraitMeta = BasicTrait | ChoiceTrait;\n\nexport interface TraitRegistration {\n trait: string;\n meta: TraitMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTraitRegistry: TraitRegistration[];\n }\n}\n\nif (root.__PlasmicTraitRegistry == null) {\n root.__PlasmicTraitRegistry = [];\n}\n\nexport default function registerTrait(trait: string, meta: TraitMeta) {\n root.__PlasmicTraitRegistry.push({\n trait,\n meta,\n });\n}\n","import { cloneElement, isValidElement } from \"react\";\n\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param index The index of the copy (starting at 0).\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(index: number, elt: T): T;\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param isPrimary should be true for at most one instance of the element, and\n * indicates which copy of the element will be highlighted when the element is\n * selected in Studio.\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(isPrimary: boolean, elt: T): T;\nexport default function repeatedElement<T>(index: boolean | number, elt: T): T {\n return repeatedElementFn(index as any, elt);\n}\n\nlet repeatedElementFn: typeof repeatedElement = (\n index: boolean | number,\n elt: any\n) => {\n if (Array.isArray(elt)) {\n return elt.map((v) => repeatedElementFn(index as any, v)) as any;\n }\n if (elt && isValidElement(elt) && typeof elt !== \"string\") {\n return cloneElement(elt) as any;\n }\n return elt;\n};\n\nconst root = globalThis as any;\nexport const setRepeatedElementFn: (fn: typeof repeatedElement) => void =\n root?.__Sub?.setRepeatedElementFn ??\n function (fn: typeof repeatedElement) {\n repeatedElementFn = fn;\n };\n","import React from \"react\";\n\nconst PlasmicLinkContext = React.createContext<\n React.ComponentType<any> | undefined\n>(undefined);\n\nexport function usePlasmicLinkMaybe():\n | React.ComponentType<React.ComponentProps<\"a\">>\n | undefined {\n return React.useContext(PlasmicLinkContext);\n}\n\nconst AnchorLink = React.forwardRef(function AnchorLink(\n props: React.ComponentProps<\"a\">,\n ref: React.Ref<HTMLAnchorElement>\n) {\n return <a {...props} ref={ref} />;\n});\n\nexport function usePlasmicLink(): React.ComponentType<\n React.ComponentProps<\"a\">\n> {\n const Link = React.useContext(PlasmicLinkContext);\n if (Link) {\n return Link;\n } else {\n return AnchorLink as React.ComponentType<React.ComponentProps<\"a\">>;\n }\n}\n\nexport function PlasmicLinkProvider(props: {\n Link: React.ComponentType<any> | undefined;\n children?: React.ReactNode;\n}) {\n const { Link, children } = props;\n return (\n <PlasmicLinkContext.Provider value={Link}>\n {children}\n </PlasmicLinkContext.Provider>\n );\n}\n","export const hostVersion = \"1.0.149\";\n","import * as PlasmicQuery from \"@plasmicapp/query\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { registerRenderErrorListener, setPlasmicRootNode } from \"./canvas-host\";\nimport * as hostModule from \"./exports\";\nimport { setRepeatedElementFn } from \"./repeatedElement\";\n// version.ts is automatically generated by `yarn build` and not committed.\nimport { hostVersion } from \"./version\";\n\n// All exports must come from \"./exports\"\nexport * from \"./exports\";\n\nconst root = globalThis as any;\n\nif (root.__Sub == null) {\n // Creating a side effect here by logging, so that vite won't\n // ignore this block for whatever reason. Hiding this for now\n // as users are complaining; will have to check if this has\n // been fixed with vite.\n // console.log(\"Plasmic: Setting up app host dependencies\");\n root.__Sub = {\n React,\n ReactDOM,\n PlasmicQuery,\n hostModule,\n hostVersion,\n hostUtils: {\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n },\n\n // For backwards compatibility:\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n ...hostModule,\n };\n}\n"],"names":["React","root"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,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oBAAoB,sBAAA,IACjB,UAAU,CACd,CAAC;;;;;"}
|
|
1
|
+
{"version":3,"file":"host.esm.js","sources":["../../../node_modules/tslib/tslib.es6.js","../src/lang-utils.ts","../src/useForceUpdate.ts","../src/canvas-host.tsx","../src/common.ts","../src/data.tsx","../src/fetcher.ts","../src/global-actions.tsx","../src/registerComponent.ts","../src/registerGlobalContext.ts","../src/registerToken.ts","../src/registerTrait.ts","../src/repeatedElement.ts","../src/link.tsx","../src/version.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function isString(x: any): x is string {\n return typeof x === \"string\";\n}\n\ntype StringGen = string | (() => string);\n\nexport function ensure<T>(x: T | null | undefined, msg: StringGen = \"\"): T {\n if (x === null || x === undefined) {\n debugger;\n msg = (isString(msg) ? msg : msg()) || \"\";\n throw new Error(\n `Value must not be undefined or null${msg ? `- ${msg}` : \"\"}`\n );\n } else {\n return x;\n }\n}\n","import { useCallback, useState } from \"react\";\n\nexport default function useForceUpdate() {\n const [, setTick] = useState(0);\n const update = useCallback(() => {\n setTick((tick) => tick + 1);\n }, []);\n return update;\n}\n","import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { ensure } from \"./lang-utils\";\nimport useForceUpdate from \"./useForceUpdate\";\n\ndeclare global {\n interface Window {\n __PlasmicHostVersion: string;\n }\n}\n\nif ((globalThis as any).__PlasmicHostVersion == null) {\n (globalThis as any).__PlasmicHostVersion = \"3\";\n}\n\nconst rootChangeListeners: (() => void)[] = [];\nclass PlasmicRootNodeWrapper {\n constructor(private value: null | React.ReactElement) {}\n set = (val: null | React.ReactElement) => {\n this.value = val;\n rootChangeListeners.forEach((f) => f());\n };\n get = () => this.value;\n}\n\nconst plasmicRootNode = new PlasmicRootNodeWrapper(null);\n\nfunction getHashParams() {\n return new URLSearchParams(location.hash.replace(/^#/, \"?\"));\n}\n\nfunction getPlasmicOrigin() {\n const params = getHashParams();\n return ensure(\n params.get(\"origin\"),\n \"Missing information from Plasmic window.\"\n );\n}\n\nfunction getStudioHash() {\n const hashParams = getHashParams();\n if (hashParams.has(\"studioHash\")) {\n return hashParams.get(\"studioHash\");\n }\n const urlParams = new URL(location.href).searchParams;\n return urlParams.get(\"studio-hash\");\n}\n\nfunction renderStudioIntoIframe() {\n const script = document.createElement(\"script\");\n const plasmicOrigin = getPlasmicOrigin();\n const hash = getStudioHash();\n script.src = `${plasmicOrigin}/static/js/studio${\n hash ? `.${hash}.js` : `.js`\n }`;\n document.body.appendChild(script);\n}\n\nlet renderCount = 0;\nexport function setPlasmicRootNode(node: React.ReactElement | null) {\n // Keep track of renderCount, which we use as key to ErrorBoundary, so\n // we can reset the error on each render\n renderCount++;\n plasmicRootNode.set(node);\n}\n\nexport interface PlasmicCanvasContextValue {\n componentName: string | null;\n globalVariants: Record<string, string>;\n interactive?: boolean;\n}\n\n/**\n * React context to detect whether the component is rendered on Plasmic editor.\n * If not, return false.\n * If so, return an object with more information about the component\n */\nexport const PlasmicCanvasContext = React.createContext<\n PlasmicCanvasContextValue | false\n>(false);\nexport const usePlasmicCanvasContext = () =>\n React.useContext(PlasmicCanvasContext);\n\nfunction _PlasmicCanvasHost() {\n // If window.parent is null, then this is a window whose containing iframe\n // has been detached from the DOM (for the top window, window.parent === window).\n // In that case, we shouldn't do anything. If window.parent is null, by the way,\n // location.hash will also be null.\n const isFrameAttached = !!window.parent;\n const isCanvas = !!location.hash?.match(/\\bcanvas=true\\b/);\n const isLive = !!location.hash?.match(/\\blive=true\\b/) || !isFrameAttached;\n const shouldRenderStudio =\n isFrameAttached &&\n !document.querySelector(\"#plasmic-studio-tag\") &&\n !isCanvas &&\n !isLive;\n const forceUpdate = useForceUpdate();\n React.useLayoutEffect(() => {\n rootChangeListeners.push(forceUpdate);\n return () => {\n const index = rootChangeListeners.indexOf(forceUpdate);\n if (index >= 0) {\n rootChangeListeners.splice(index, 1);\n }\n };\n }, [forceUpdate]);\n React.useEffect(() => {\n if (shouldRenderStudio && isFrameAttached && window.parent !== window) {\n renderStudioIntoIframe();\n }\n }, [shouldRenderStudio, isFrameAttached]);\n React.useEffect(() => {\n if (!shouldRenderStudio && !document.querySelector(\"#getlibs\") && isLive) {\n const scriptElt = document.createElement(\"script\");\n scriptElt.id = \"getlibs\";\n scriptElt.src = getPlasmicOrigin() + \"/static/js/getlibs.js\";\n scriptElt.async = false;\n scriptElt.onload = () => {\n (window as any).__GetlibsReadyResolver?.();\n };\n document.head.append(scriptElt);\n }\n }, [shouldRenderStudio]);\n\n const [canvasContextValue, setCanvasContextValue] = React.useState(() =>\n deriveCanvasContextValue()\n );\n\n React.useEffect(() => {\n if (isCanvas) {\n const listener = () => {\n setCanvasContextValue(deriveCanvasContextValue());\n };\n window.addEventListener(\"hashchange\", listener);\n return () => window.removeEventListener(\"hashchange\", listener);\n }\n return undefined;\n }, [isCanvas]);\n if (!isFrameAttached) {\n return null;\n }\n if (isCanvas || isLive) {\n let appDiv = document.querySelector(\"#plasmic-app.__wab_user-body\");\n if (!appDiv) {\n appDiv = document.createElement(\"div\");\n appDiv.id = \"plasmic-app\";\n appDiv.classList.add(\"__wab_user-body\");\n document.body.appendChild(appDiv);\n }\n return ReactDOM.createPortal(\n <ErrorBoundary key={`${renderCount}`}>\n <PlasmicCanvasContext.Provider value={canvasContextValue}>\n {plasmicRootNode.get()}\n </PlasmicCanvasContext.Provider>\n </ErrorBoundary>,\n appDiv,\n \"plasmic-app\"\n );\n }\n if (shouldRenderStudio && window.parent === window) {\n return (\n <iframe\n src={`https://docs.plasmic.app/app-content/app-host-ready#appHostUrl=${encodeURIComponent(\n location.href\n )}`}\n style={{\n width: \"100vw\",\n height: \"100vh\",\n border: \"none\",\n position: \"fixed\",\n top: 0,\n left: 0,\n zIndex: 99999999,\n }}\n ></iframe>\n );\n }\n return null;\n}\n\ninterface PlasmicCanvasHostProps {\n /**\n * Webpack hmr uses EventSource to\tlisten to hot reloads, but that\n * resultsin a persistent\tconnection from\teach window. In Plasmic\n * Studio, if a project is configured to use app-hosting with a\n * nextjs or gatsby server running in dev mode, each artboard will\n * be holding a persistent connection to the dev server.\n * Because browsers\thave a limit to\thow many connections can\n * be held\tat a time by domain, this means\tafter X\tartboards, new\n * artboards will freeze and not load.\n *\n * By default, <PlasmicCanvasHost /> will globally mutate\n * window.EventSource to avoid using EventSource for HMR, which you\n * typically don't need for your custom host page. If you do still\n * want to retain HRM, then youc an pass enableWebpackHmr={true}.\n */\n enableWebpackHmr?: boolean;\n}\n\nexport const PlasmicCanvasHost: React.FunctionComponent<\n PlasmicCanvasHostProps\n> = (props) => {\n const { enableWebpackHmr } = props;\n const [node, setNode] = React.useState<React.ReactElement<any, any> | null>(\n null\n );\n React.useEffect(() => {\n setNode(<_PlasmicCanvasHost />);\n }, []);\n return (\n <>\n {!enableWebpackHmr && <DisableWebpackHmr />}\n {node}\n </>\n );\n};\n\ntype RenderErrorListener = (err: Error) => void;\nconst renderErrorListeners: RenderErrorListener[] = [];\nexport function registerRenderErrorListener(listener: RenderErrorListener) {\n renderErrorListeners.push(listener);\n return () => {\n const index = renderErrorListeners.indexOf(listener);\n if (index >= 0) {\n renderErrorListeners.splice(index, 1);\n }\n };\n}\n\ninterface ErrorBoundaryProps {\n children?: React.ReactNode;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nclass ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {};\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error) {\n renderErrorListeners.forEach((listener) => listener(error));\n }\n\n render() {\n if (this.state.error) {\n return <div>Error: {`${this.state.error.message}`}</div>;\n } else {\n return <>{this.props.children}</>;\n }\n }\n}\n\nfunction DisableWebpackHmr() {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n return (\n <script\n type=\"text/javascript\"\n dangerouslySetInnerHTML={{\n __html: `\n if (typeof window !== \"undefined\") {\n const RealEventSource = window.EventSource;\n window.EventSource = function(url, config) {\n if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {\n console.warn(\"Plasmic: disabled EventSource request for\", url);\n return {\n onerror() {}, onmessage() {}, onopen() {}, close() {}\n };\n } else {\n return new RealEventSource(url, config);\n }\n }\n }\n `,\n }}\n ></script>\n );\n}\n\nfunction deriveCanvasContextValue(): PlasmicCanvasContextValue | false {\n const hash = window.location.hash;\n if (hash && hash.length > 0) {\n // create URLsearchParams skipping the initial # character\n const params = new URLSearchParams(hash.substring(1));\n if (params.get(\"canvas\") === \"true\") {\n const globalVariants = params.get(\"globalVariants\");\n return {\n componentName: params.get(\"componentName\") ?? null,\n globalVariants: globalVariants ? JSON.parse(globalVariants) : {},\n interactive: params.get(\"interactive\") === \"true\",\n };\n }\n }\n return false;\n}\n","export const tuple = <T extends any[]>(...args: T): T => args;\n","import React, {\n createContext,\n ReactElement,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport type DataMeta = {\n hidden?: boolean;\n label?: string;\n};\n\nexport function mkMetaName(name: string) {\n return `__plasmic_meta_${name}`;\n}\n\nexport function mkMetaValue(meta: Partial<DataMeta>): DataMeta {\n return meta;\n}\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n /**\n * Key to set in data context.\n */\n name?: string;\n /**\n * Value to set for `name` in data context.\n */\n data?: any;\n /**\n * If true, hide this entry in studio (data binding).\n */\n hidden?: boolean;\n /**\n * Label to be shown in the studio data picker for easier navigation (data binding).\n */\n label?: string;\n children?: ReactNode;\n}\n\nexport function DataProvider({\n name,\n data,\n hidden,\n label,\n children,\n}: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider\n value={{\n ...existingEnv,\n [name]: data,\n [mkMetaName(name)]: mkMetaValue({ hidden, label }),\n }}\n >\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface PageParamsProviderProps {\n params?: Record<string, string | string[] | undefined>;\n query?: Record<string, string | string[] | undefined>;\n children?: ReactNode;\n}\n\nexport function PageParamsProvider({\n children,\n params = {},\n query = {},\n}: PageParamsProviderProps) {\n const $ctx = useDataEnv() || {};\n return (\n <DataProvider\n name={\"params\"}\n data={{ ...$ctx.params, ...params }}\n label={\"Page URL path params\"}\n >\n <DataProvider\n name={\"query\"}\n data={{ ...$ctx.query, ...query }}\n label={\"Page URL query params\"}\n >\n {children}\n </DataProvider>\n </DataProvider>\n );\n}\n\nexport function DataCtxReader({\n children,\n}: {\n children: ($ctx: DataDict | undefined) => ReactNode;\n}) {\n const $ctx = useDataEnv();\n return children($ctx) as ReactElement | null;\n}\n","import { PrimitiveType } from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport type Fetcher = (...args: any[]) => Promise<any>;\n\nexport interface FetcherMeta {\n /**\n * Any unique identifying string for this fetcher.\n */\n name: string;\n /**\n * The Studio-user-friendly display name.\n */\n displayName?: string;\n /**\n * The symbol to import from the importPath.\n */\n importName?: string;\n args: { name: string; type: PrimitiveType }[];\n returns: PrimitiveType;\n /**\n * Either the path to the fetcher relative to `rootDir` or the npm\n * package name\n */\n importPath: string;\n /**\n * Whether it's a default export or named export\n */\n isDefaultExport?: boolean;\n}\n\nexport interface FetcherRegistration {\n fetcher: Fetcher;\n meta: FetcherMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicFetcherRegistry: FetcherRegistration[];\n }\n}\n\nroot.__PlasmicFetcherRegistry = [];\n\nexport function registerFetcher(fetcher: Fetcher, meta: FetcherMeta) {\n root.__PlasmicFetcherRegistry.push({ fetcher, meta });\n}\n","import React from \"react\";\n\nexport type GlobalActionDict = Record<string, Function>;\n\nexport const GlobalActionsContext = React.createContext<\n GlobalActionDict | undefined\n>(undefined);\n\nexport function GlobalActionsProvider(props: {\n contextName: string;\n children?: React.ReactNode;\n actions: GlobalActionDict;\n}) {\n const { contextName, children, actions } = props;\n const namespacedActions = React.useMemo(\n () =>\n Object.fromEntries(\n Object.entries(actions).map(([key, val]) => [\n `${contextName}.${key}`,\n val,\n ])\n ),\n [contextName, actions]\n );\n return (\n <GlobalActionsContext.Provider value={namespacedActions}>\n {children}\n </GlobalActionsContext.Provider>\n );\n}\n\nexport function useGlobalActions() {\n return React.useContext(GlobalActionsContext) ?? {};\n}\n","import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n onMutate?: (stateValue: T, $ref: any) => void;\n}\n\n// A compile-time error will occur if a new field is added to the StateHelper \n// interface but not included in the keys array of state helper.\ntype TupleUnion<U extends string, R extends string[] = []> = {\n [S in U]: Exclude<U, S> extends never\n ? [...R, S]\n : TupleUnion<Exclude<U, S>, [...R, S]>;\n}[U] &\n string[];\n\nexport const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>> = [\n \"initFunc\",\n \"onChangeArgsToValue\",\n \"onMutate\",\n];\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n","import {\n BooleanType,\n ChoiceType,\n CustomType,\n JSONLikeType,\n NumberType,\n StringType,\n DataSourceType,\n} from \"./prop-types\";\nimport { FunctionParam } from \"./registerComponent\";\n\nconst root = globalThis as any;\n\n// Using just a subset of types from prop-types\nexport type PropType<P> =\n | StringType<P>\n | BooleanType<P>\n | NumberType<P>\n | JSONLikeType<P>\n | ChoiceType<P>\n | CustomType<P>\n | DataSourceType<P>;\n\ntype RestrictPropType<T, P> = T extends string\n ? StringType<P> | ChoiceType<P> | JSONLikeType<P> | CustomType<P>\n : T extends boolean\n ? BooleanType<P> | JSONLikeType<P> | CustomType<P>\n : T extends number\n ? NumberType<P> | JSONLikeType<P> | CustomType<P>\n : PropType<P>;\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\nexport interface GlobalContextMeta<P> {\n /**\n * Any unique string name used to identify that context. Each context\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the context in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the context to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the context properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * The path to be used when importing the context in the generated code.\n * It can be the name of the package that contains the context, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the context is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Whether the global context provides data to its children using DataProvider.\n */\n providesData?: boolean;\n\n unstable__globalActions?: Record<string, GlobalActionRegistration<P>>;\n}\n\nexport interface GlobalContextRegistration {\n component: React.ComponentType<any>;\n meta: GlobalContextMeta<any>;\n}\n\nexport interface GlobalActionRegistration<P> {\n displayName?: string;\n description?: string;\n parameters: FunctionParam<P>[];\n}\n\ndeclare global {\n interface Window {\n __PlasmicContextRegistry: GlobalContextRegistration[];\n }\n}\n\nif (root.__PlasmicContextRegistry == null) {\n root.__PlasmicContextRegistry = [];\n}\n\nexport default function registerGlobalContext<\n T extends React.ComponentType<any>\n>(component: T, meta: GlobalContextMeta<React.ComponentProps<T>>) {\n // Check for duplicates\n if (\n root.__PlasmicContextRegistry.some(\n (r: GlobalContextRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicContextRegistry.push({ component, meta });\n}\n","export type TokenType =\n | \"color\"\n | \"spacing\"\n | \"font-family\"\n | \"font-size\"\n | \"line-height\"\n | \"opacity\";\n\nexport interface TokenRegistration {\n name: string;\n displayName: string;\n value: string;\n type: TokenType;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTokenRegistry: TokenRegistration[];\n }\n}\n\nconst root = globalThis as any;\n\nif (root.__PlasmicTokenRegistry == null) {\n root.__PlasmicTokenRegistry = [];\n}\n\nexport default function registerToken(token: TokenRegistration) {\n root.__PlasmicTokenRegistry.push(token);\n}\n","const root = globalThis as any;\n\nexport interface BasicTrait {\n label?: string;\n type: \"text\" | \"number\" | \"boolean\";\n}\n\nexport interface ChoiceTrait {\n label?: string;\n type: \"choice\";\n options: string[];\n}\n\nexport type TraitMeta = BasicTrait | ChoiceTrait;\n\nexport interface TraitRegistration {\n trait: string;\n meta: TraitMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTraitRegistry: TraitRegistration[];\n }\n}\n\nif (root.__PlasmicTraitRegistry == null) {\n root.__PlasmicTraitRegistry = [];\n}\n\nexport default function registerTrait(trait: string, meta: TraitMeta) {\n root.__PlasmicTraitRegistry.push({\n trait,\n meta,\n });\n}\n","import { cloneElement, isValidElement } from \"react\";\n\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param index The index of the copy (starting at 0).\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(index: number, elt: T): T;\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param isPrimary should be true for at most one instance of the element, and\n * indicates which copy of the element will be highlighted when the element is\n * selected in Studio.\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(isPrimary: boolean, elt: T): T;\nexport default function repeatedElement<T>(index: boolean | number, elt: T): T {\n return repeatedElementFn(index as any, elt);\n}\n\nlet repeatedElementFn: typeof repeatedElement = (\n index: boolean | number,\n elt: any\n) => {\n if (Array.isArray(elt)) {\n return elt.map((v) => repeatedElementFn(index as any, v)) as any;\n }\n if (elt && isValidElement(elt) && typeof elt !== \"string\") {\n return cloneElement(elt) as any;\n }\n return elt;\n};\n\nconst root = globalThis as any;\nexport const setRepeatedElementFn: (fn: typeof repeatedElement) => void =\n root?.__Sub?.setRepeatedElementFn ??\n function (fn: typeof repeatedElement) {\n repeatedElementFn = fn;\n };\n","import React from \"react\";\n\nconst PlasmicLinkContext = React.createContext<\n React.ComponentType<any> | undefined\n>(undefined);\n\nexport function usePlasmicLinkMaybe():\n | React.ComponentType<React.ComponentProps<\"a\">>\n | undefined {\n return React.useContext(PlasmicLinkContext);\n}\n\nconst AnchorLink = React.forwardRef(function AnchorLink(\n props: React.ComponentProps<\"a\">,\n ref: React.Ref<HTMLAnchorElement>\n) {\n return <a {...props} ref={ref} />;\n});\n\nexport function usePlasmicLink(): React.ComponentType<\n React.ComponentProps<\"a\">\n> {\n const Link = React.useContext(PlasmicLinkContext);\n if (Link) {\n return Link;\n } else {\n return AnchorLink as React.ComponentType<React.ComponentProps<\"a\">>;\n }\n}\n\nexport function PlasmicLinkProvider(props: {\n Link: React.ComponentType<any> | undefined;\n children?: React.ReactNode;\n}) {\n const { Link, children } = props;\n return (\n <PlasmicLinkContext.Provider value={Link}>\n {children}\n </PlasmicLinkContext.Provider>\n );\n}\n","export const hostVersion = \"1.0.150\";\n","import * as PlasmicQuery from \"@plasmicapp/query\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { registerRenderErrorListener, setPlasmicRootNode } from \"./canvas-host\";\nimport * as hostModule from \"./exports\";\nimport { setRepeatedElementFn } from \"./repeatedElement\";\n// version.ts is automatically generated by `yarn build` and not committed.\nimport { hostVersion } from \"./version\";\n\n// All exports must come from \"./exports\"\nexport * from \"./exports\";\n\nconst root = globalThis as any;\n\nif (root.__Sub == null) {\n // Creating a side effect here by logging, so that vite won't\n // ignore this block for whatever reason. Hiding this for now\n // as users are complaining; will have to check if this has\n // been fixed with vite.\n // console.log(\"Plasmic: Setting up app host dependencies\");\n root.__Sub = {\n React,\n ReactDOM,\n PlasmicQuery,\n hostModule,\n hostVersion,\n hostUtils: {\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n },\n\n // For backwards compatibility:\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n ...hostModule,\n };\n}\n"],"names":["React","root"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AACF;AACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;AAChC,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;AAC7C,QAAQ,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;AAClG,IAAI,aAAa,CAAC,CAAC,EA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EjC,OAAOA,+CAAO,KAAK,IAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACpC,CAAC,CAAC,CAAC;SAEa,cAAc;IAG5B,IAAM,IAAI,GAAGA,cAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAClD,IAAI,IAAI,EAAE;QACR,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,UAA4D,CAAC;KACrE;AACH,CAAC;SAEe,mBAAmB,CAAC,KAGnC;IACS,IAAA,IAAI,GAAe,KAAK,KAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;IACjC,QACEA,6BAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,IACrC,QAAQ,CACmB,EAC9B;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxCO,IAAM,WAAW,GAAG,SAAS;;ACYpC,IAAM,IAAI,GAAG,UAAiB,CAAC;AAE/B,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;;;;;;IAMtB,IAAI,CAAC,KAAK,cACR,KAAK,OAAA,EACL,QAAQ,UAAA,EACR,YAAY,cAAA,EACZ,UAAU,YAAA,EACV,WAAW,aAAA,EACX,SAAS,EAAE;YACT,kBAAkB,oBAAA;YAClB,2BAA2B,6BAAA;YAC3B,oBAAoB,sBAAA;SACrB;;QAGD,kBAAkB,oBAAA,EAClB,2BAA2B,6BAAA,EAC3B,oBAAoB,sBAAA,IACjB,UAAU,CACd,CAAC;;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -401,6 +401,11 @@ function useGlobalActions() {
|
|
|
401
401
|
}
|
|
402
402
|
|
|
403
403
|
var root$5 = globalThis;
|
|
404
|
+
var stateHelpersKeys = [
|
|
405
|
+
"initFunc",
|
|
406
|
+
"onChangeArgsToValue",
|
|
407
|
+
"onMutate",
|
|
408
|
+
];
|
|
404
409
|
if (root$5.__PlasmicComponentRegistry == null) {
|
|
405
410
|
root$5.__PlasmicComponentRegistry = [];
|
|
406
411
|
}
|
|
@@ -493,6 +498,7 @@ var hostModule = /*#__PURE__*/Object.freeze({
|
|
|
493
498
|
usePlasmicCanvasContext: usePlasmicCanvasContext,
|
|
494
499
|
unstable_registerFetcher: registerFetcher,
|
|
495
500
|
registerComponent: registerComponent,
|
|
501
|
+
stateHelpersKeys: stateHelpersKeys,
|
|
496
502
|
registerGlobalContext: registerGlobalContext,
|
|
497
503
|
registerToken: registerToken,
|
|
498
504
|
registerTrait: registerTrait,
|
|
@@ -515,7 +521,7 @@ var hostModule = /*#__PURE__*/Object.freeze({
|
|
|
515
521
|
PlasmicLinkProvider: PlasmicLinkProvider
|
|
516
522
|
});
|
|
517
523
|
|
|
518
|
-
var hostVersion = "1.0.
|
|
524
|
+
var hostVersion = "1.0.150";
|
|
519
525
|
|
|
520
526
|
var root = globalThis;
|
|
521
527
|
if (root.__Sub == null) {
|
|
@@ -550,6 +556,7 @@ exports.registerGlobalContext = registerGlobalContext;
|
|
|
550
556
|
exports.registerToken = registerToken;
|
|
551
557
|
exports.registerTrait = registerTrait;
|
|
552
558
|
exports.repeatedElement = repeatedElement;
|
|
559
|
+
exports.stateHelpersKeys = stateHelpersKeys;
|
|
553
560
|
exports.unstable_registerFetcher = registerFetcher;
|
|
554
561
|
exports.useDataEnv = useDataEnv;
|
|
555
562
|
exports.useGlobalActions = useGlobalActions;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../../node_modules/tslib/tslib.es6.js","../src/lang-utils.ts","../src/useForceUpdate.ts","../src/canvas-host.tsx","../src/common.ts","../src/data.tsx","../src/fetcher.ts","../src/global-actions.tsx","../src/registerComponent.ts","../src/registerGlobalContext.ts","../src/registerToken.ts","../src/registerTrait.ts","../src/repeatedElement.ts","../src/link.tsx","../src/version.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function isString(x: any): x is string {\n return typeof x === \"string\";\n}\n\ntype StringGen = string | (() => string);\n\nexport function ensure<T>(x: T | null | undefined, msg: StringGen = \"\"): T {\n if (x === null || x === undefined) {\n debugger;\n msg = (isString(msg) ? msg : msg()) || \"\";\n throw new Error(\n `Value must not be undefined or null${msg ? `- ${msg}` : \"\"}`\n );\n } else {\n return x;\n }\n}\n","import { useCallback, useState } from \"react\";\n\nexport default function useForceUpdate() {\n const [, setTick] = useState(0);\n const update = useCallback(() => {\n setTick((tick) => tick + 1);\n }, []);\n return update;\n}\n","import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { ensure } from \"./lang-utils\";\nimport useForceUpdate from \"./useForceUpdate\";\n\ndeclare global {\n interface Window {\n __PlasmicHostVersion: string;\n }\n}\n\nif ((globalThis as any).__PlasmicHostVersion == null) {\n (globalThis as any).__PlasmicHostVersion = \"3\";\n}\n\nconst rootChangeListeners: (() => void)[] = [];\nclass PlasmicRootNodeWrapper {\n constructor(private value: null | React.ReactElement) {}\n set = (val: null | React.ReactElement) => {\n this.value = val;\n rootChangeListeners.forEach((f) => f());\n };\n get = () => this.value;\n}\n\nconst plasmicRootNode = new PlasmicRootNodeWrapper(null);\n\nfunction getHashParams() {\n return new URLSearchParams(location.hash.replace(/^#/, \"?\"));\n}\n\nfunction getPlasmicOrigin() {\n const params = getHashParams();\n return ensure(\n params.get(\"origin\"),\n \"Missing information from Plasmic window.\"\n );\n}\n\nfunction getStudioHash() {\n const hashParams = getHashParams();\n if (hashParams.has(\"studioHash\")) {\n return hashParams.get(\"studioHash\");\n }\n const urlParams = new URL(location.href).searchParams;\n return urlParams.get(\"studio-hash\");\n}\n\nfunction renderStudioIntoIframe() {\n const script = document.createElement(\"script\");\n const plasmicOrigin = getPlasmicOrigin();\n const hash = getStudioHash();\n script.src = `${plasmicOrigin}/static/js/studio${\n hash ? `.${hash}.js` : `.js`\n }`;\n document.body.appendChild(script);\n}\n\nlet renderCount = 0;\nexport function setPlasmicRootNode(node: React.ReactElement | null) {\n // Keep track of renderCount, which we use as key to ErrorBoundary, so\n // we can reset the error on each render\n renderCount++;\n plasmicRootNode.set(node);\n}\n\nexport interface PlasmicCanvasContextValue {\n componentName: string | null;\n globalVariants: Record<string, string>;\n interactive?: boolean;\n}\n\n/**\n * React context to detect whether the component is rendered on Plasmic editor.\n * If not, return false.\n * If so, return an object with more information about the component\n */\nexport const PlasmicCanvasContext = React.createContext<\n PlasmicCanvasContextValue | false\n>(false);\nexport const usePlasmicCanvasContext = () =>\n React.useContext(PlasmicCanvasContext);\n\nfunction _PlasmicCanvasHost() {\n // If window.parent is null, then this is a window whose containing iframe\n // has been detached from the DOM (for the top window, window.parent === window).\n // In that case, we shouldn't do anything. If window.parent is null, by the way,\n // location.hash will also be null.\n const isFrameAttached = !!window.parent;\n const isCanvas = !!location.hash?.match(/\\bcanvas=true\\b/);\n const isLive = !!location.hash?.match(/\\blive=true\\b/) || !isFrameAttached;\n const shouldRenderStudio =\n isFrameAttached &&\n !document.querySelector(\"#plasmic-studio-tag\") &&\n !isCanvas &&\n !isLive;\n const forceUpdate = useForceUpdate();\n React.useLayoutEffect(() => {\n rootChangeListeners.push(forceUpdate);\n return () => {\n const index = rootChangeListeners.indexOf(forceUpdate);\n if (index >= 0) {\n rootChangeListeners.splice(index, 1);\n }\n };\n }, [forceUpdate]);\n React.useEffect(() => {\n if (shouldRenderStudio && isFrameAttached && window.parent !== window) {\n renderStudioIntoIframe();\n }\n }, [shouldRenderStudio, isFrameAttached]);\n React.useEffect(() => {\n if (!shouldRenderStudio && !document.querySelector(\"#getlibs\") && isLive) {\n const scriptElt = document.createElement(\"script\");\n scriptElt.id = \"getlibs\";\n scriptElt.src = getPlasmicOrigin() + \"/static/js/getlibs.js\";\n scriptElt.async = false;\n scriptElt.onload = () => {\n (window as any).__GetlibsReadyResolver?.();\n };\n document.head.append(scriptElt);\n }\n }, [shouldRenderStudio]);\n\n const [canvasContextValue, setCanvasContextValue] = React.useState(() =>\n deriveCanvasContextValue()\n );\n\n React.useEffect(() => {\n if (isCanvas) {\n const listener = () => {\n setCanvasContextValue(deriveCanvasContextValue());\n };\n window.addEventListener(\"hashchange\", listener);\n return () => window.removeEventListener(\"hashchange\", listener);\n }\n return undefined;\n }, [isCanvas]);\n if (!isFrameAttached) {\n return null;\n }\n if (isCanvas || isLive) {\n let appDiv = document.querySelector(\"#plasmic-app.__wab_user-body\");\n if (!appDiv) {\n appDiv = document.createElement(\"div\");\n appDiv.id = \"plasmic-app\";\n appDiv.classList.add(\"__wab_user-body\");\n document.body.appendChild(appDiv);\n }\n return ReactDOM.createPortal(\n <ErrorBoundary key={`${renderCount}`}>\n <PlasmicCanvasContext.Provider value={canvasContextValue}>\n {plasmicRootNode.get()}\n </PlasmicCanvasContext.Provider>\n </ErrorBoundary>,\n appDiv,\n \"plasmic-app\"\n );\n }\n if (shouldRenderStudio && window.parent === window) {\n return (\n <iframe\n src={`https://docs.plasmic.app/app-content/app-host-ready#appHostUrl=${encodeURIComponent(\n location.href\n )}`}\n style={{\n width: \"100vw\",\n height: \"100vh\",\n border: \"none\",\n position: \"fixed\",\n top: 0,\n left: 0,\n zIndex: 99999999,\n }}\n ></iframe>\n );\n }\n return null;\n}\n\ninterface PlasmicCanvasHostProps {\n /**\n * Webpack hmr uses EventSource to\tlisten to hot reloads, but that\n * resultsin a persistent\tconnection from\teach window. In Plasmic\n * Studio, if a project is configured to use app-hosting with a\n * nextjs or gatsby server running in dev mode, each artboard will\n * be holding a persistent connection to the dev server.\n * Because browsers\thave a limit to\thow many connections can\n * be held\tat a time by domain, this means\tafter X\tartboards, new\n * artboards will freeze and not load.\n *\n * By default, <PlasmicCanvasHost /> will globally mutate\n * window.EventSource to avoid using EventSource for HMR, which you\n * typically don't need for your custom host page. If you do still\n * want to retain HRM, then youc an pass enableWebpackHmr={true}.\n */\n enableWebpackHmr?: boolean;\n}\n\nexport const PlasmicCanvasHost: React.FunctionComponent<\n PlasmicCanvasHostProps\n> = (props) => {\n const { enableWebpackHmr } = props;\n const [node, setNode] = React.useState<React.ReactElement<any, any> | null>(\n null\n );\n React.useEffect(() => {\n setNode(<_PlasmicCanvasHost />);\n }, []);\n return (\n <>\n {!enableWebpackHmr && <DisableWebpackHmr />}\n {node}\n </>\n );\n};\n\ntype RenderErrorListener = (err: Error) => void;\nconst renderErrorListeners: RenderErrorListener[] = [];\nexport function registerRenderErrorListener(listener: RenderErrorListener) {\n renderErrorListeners.push(listener);\n return () => {\n const index = renderErrorListeners.indexOf(listener);\n if (index >= 0) {\n renderErrorListeners.splice(index, 1);\n }\n };\n}\n\ninterface ErrorBoundaryProps {\n children?: React.ReactNode;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nclass ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {};\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error) {\n renderErrorListeners.forEach((listener) => listener(error));\n }\n\n render() {\n if (this.state.error) {\n return <div>Error: {`${this.state.error.message}`}</div>;\n } else {\n return <>{this.props.children}</>;\n }\n }\n}\n\nfunction DisableWebpackHmr() {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n return (\n <script\n type=\"text/javascript\"\n dangerouslySetInnerHTML={{\n __html: `\n if (typeof window !== \"undefined\") {\n const RealEventSource = window.EventSource;\n window.EventSource = function(url, config) {\n if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {\n console.warn(\"Plasmic: disabled EventSource request for\", url);\n return {\n onerror() {}, onmessage() {}, onopen() {}, close() {}\n };\n } else {\n return new RealEventSource(url, config);\n }\n }\n }\n `,\n }}\n ></script>\n );\n}\n\nfunction deriveCanvasContextValue(): PlasmicCanvasContextValue | false {\n const hash = window.location.hash;\n if (hash && hash.length > 0) {\n // create URLsearchParams skipping the initial # character\n const params = new URLSearchParams(hash.substring(1));\n if (params.get(\"canvas\") === \"true\") {\n const globalVariants = params.get(\"globalVariants\");\n return {\n componentName: params.get(\"componentName\") ?? null,\n globalVariants: globalVariants ? JSON.parse(globalVariants) : {},\n interactive: params.get(\"interactive\") === \"true\",\n };\n }\n }\n return false;\n}\n","export const tuple = <T extends any[]>(...args: T): T => args;\n","import React, {\n createContext,\n ReactElement,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport type DataMeta = {\n hidden?: boolean;\n label?: string;\n};\n\nexport function mkMetaName(name: string) {\n return `__plasmic_meta_${name}`;\n}\n\nexport function mkMetaValue(meta: Partial<DataMeta>): DataMeta {\n return meta;\n}\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n /**\n * Key to set in data context.\n */\n name?: string;\n /**\n * Value to set for `name` in data context.\n */\n data?: any;\n /**\n * If true, hide this entry in studio (data binding).\n */\n hidden?: boolean;\n /**\n * Label to be shown in the studio data picker for easier navigation (data binding).\n */\n label?: string;\n children?: ReactNode;\n}\n\nexport function DataProvider({\n name,\n data,\n hidden,\n label,\n children,\n}: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider\n value={{\n ...existingEnv,\n [name]: data,\n [mkMetaName(name)]: mkMetaValue({ hidden, label }),\n }}\n >\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface PageParamsProviderProps {\n params?: Record<string, string | string[] | undefined>;\n query?: Record<string, string | string[] | undefined>;\n children?: ReactNode;\n}\n\nexport function PageParamsProvider({\n children,\n params = {},\n query = {},\n}: PageParamsProviderProps) {\n const $ctx = useDataEnv() || {};\n return (\n <DataProvider\n name={\"params\"}\n data={{ ...$ctx.params, ...params }}\n label={\"Page URL path params\"}\n >\n <DataProvider\n name={\"query\"}\n data={{ ...$ctx.query, ...query }}\n label={\"Page URL query params\"}\n >\n {children}\n </DataProvider>\n </DataProvider>\n );\n}\n\nexport function DataCtxReader({\n children,\n}: {\n children: ($ctx: DataDict | undefined) => ReactNode;\n}) {\n const $ctx = useDataEnv();\n return children($ctx) as ReactElement | null;\n}\n","import { PrimitiveType } from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport type Fetcher = (...args: any[]) => Promise<any>;\n\nexport interface FetcherMeta {\n /**\n * Any unique identifying string for this fetcher.\n */\n name: string;\n /**\n * The Studio-user-friendly display name.\n */\n displayName?: string;\n /**\n * The symbol to import from the importPath.\n */\n importName?: string;\n args: { name: string; type: PrimitiveType }[];\n returns: PrimitiveType;\n /**\n * Either the path to the fetcher relative to `rootDir` or the npm\n * package name\n */\n importPath: string;\n /**\n * Whether it's a default export or named export\n */\n isDefaultExport?: boolean;\n}\n\nexport interface FetcherRegistration {\n fetcher: Fetcher;\n meta: FetcherMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicFetcherRegistry: FetcherRegistration[];\n }\n}\n\nroot.__PlasmicFetcherRegistry = [];\n\nexport function registerFetcher(fetcher: Fetcher, meta: FetcherMeta) {\n root.__PlasmicFetcherRegistry.push({ fetcher, meta });\n}\n","import React from \"react\";\n\nexport type GlobalActionDict = Record<string, Function>;\n\nexport const GlobalActionsContext = React.createContext<\n GlobalActionDict | undefined\n>(undefined);\n\nexport function GlobalActionsProvider(props: {\n contextName: string;\n children?: React.ReactNode;\n actions: GlobalActionDict;\n}) {\n const { contextName, children, actions } = props;\n const namespacedActions = React.useMemo(\n () =>\n Object.fromEntries(\n Object.entries(actions).map(([key, val]) => [\n `${contextName}.${key}`,\n val,\n ])\n ),\n [contextName, actions]\n );\n return (\n <GlobalActionsContext.Provider value={namespacedActions}>\n {children}\n </GlobalActionsContext.Provider>\n );\n}\n\nexport function useGlobalActions() {\n return React.useContext(GlobalActionsContext) ?? {};\n}\n","import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n}\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n","import {\n BooleanType,\n ChoiceType,\n CustomType,\n JSONLikeType,\n NumberType,\n StringType,\n DataSourceType,\n} from \"./prop-types\";\nimport { FunctionParam } from \"./registerComponent\";\n\nconst root = globalThis as any;\n\n// Using just a subset of types from prop-types\nexport type PropType<P> =\n | StringType<P>\n | BooleanType<P>\n | NumberType<P>\n | JSONLikeType<P>\n | ChoiceType<P>\n | CustomType<P>\n | DataSourceType<P>;\n\ntype RestrictPropType<T, P> = T extends string\n ? StringType<P> | ChoiceType<P> | JSONLikeType<P> | CustomType<P>\n : T extends boolean\n ? BooleanType<P> | JSONLikeType<P> | CustomType<P>\n : T extends number\n ? NumberType<P> | JSONLikeType<P> | CustomType<P>\n : PropType<P>;\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\nexport interface GlobalContextMeta<P> {\n /**\n * Any unique string name used to identify that context. Each context\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the context in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the context to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the context properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * The path to be used when importing the context in the generated code.\n * It can be the name of the package that contains the context, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the context is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Whether the global context provides data to its children using DataProvider.\n */\n providesData?: boolean;\n\n unstable__globalActions?: Record<string, GlobalActionRegistration<P>>;\n}\n\nexport interface GlobalContextRegistration {\n component: React.ComponentType<any>;\n meta: GlobalContextMeta<any>;\n}\n\nexport interface GlobalActionRegistration<P> {\n displayName?: string;\n description?: string;\n parameters: FunctionParam<P>[];\n}\n\ndeclare global {\n interface Window {\n __PlasmicContextRegistry: GlobalContextRegistration[];\n }\n}\n\nif (root.__PlasmicContextRegistry == null) {\n root.__PlasmicContextRegistry = [];\n}\n\nexport default function registerGlobalContext<\n T extends React.ComponentType<any>\n>(component: T, meta: GlobalContextMeta<React.ComponentProps<T>>) {\n // Check for duplicates\n if (\n root.__PlasmicContextRegistry.some(\n (r: GlobalContextRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicContextRegistry.push({ component, meta });\n}\n","export type TokenType =\n | \"color\"\n | \"spacing\"\n | \"font-family\"\n | \"font-size\"\n | \"line-height\"\n | \"opacity\";\n\nexport interface TokenRegistration {\n name: string;\n displayName: string;\n value: string;\n type: TokenType;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTokenRegistry: TokenRegistration[];\n }\n}\n\nconst root = globalThis as any;\n\nif (root.__PlasmicTokenRegistry == null) {\n root.__PlasmicTokenRegistry = [];\n}\n\nexport default function registerToken(token: TokenRegistration) {\n root.__PlasmicTokenRegistry.push(token);\n}\n","const root = globalThis as any;\n\nexport interface BasicTrait {\n label?: string;\n type: \"text\" | \"number\" | \"boolean\";\n}\n\nexport interface ChoiceTrait {\n label?: string;\n type: \"choice\";\n options: string[];\n}\n\nexport type TraitMeta = BasicTrait | ChoiceTrait;\n\nexport interface TraitRegistration {\n trait: string;\n meta: TraitMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTraitRegistry: TraitRegistration[];\n }\n}\n\nif (root.__PlasmicTraitRegistry == null) {\n root.__PlasmicTraitRegistry = [];\n}\n\nexport default function registerTrait(trait: string, meta: TraitMeta) {\n root.__PlasmicTraitRegistry.push({\n trait,\n meta,\n });\n}\n","import { cloneElement, isValidElement } from \"react\";\n\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param index The index of the copy (starting at 0).\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(index: number, elt: T): T;\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param isPrimary should be true for at most one instance of the element, and\n * indicates which copy of the element will be highlighted when the element is\n * selected in Studio.\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(isPrimary: boolean, elt: T): T;\nexport default function repeatedElement<T>(index: boolean | number, elt: T): T {\n return repeatedElementFn(index as any, elt);\n}\n\nlet repeatedElementFn: typeof repeatedElement = (\n index: boolean | number,\n elt: any\n) => {\n if (Array.isArray(elt)) {\n return elt.map((v) => repeatedElementFn(index as any, v)) as any;\n }\n if (elt && isValidElement(elt) && typeof elt !== \"string\") {\n return cloneElement(elt) as any;\n }\n return elt;\n};\n\nconst root = globalThis as any;\nexport const setRepeatedElementFn: (fn: typeof repeatedElement) => void =\n root?.__Sub?.setRepeatedElementFn ??\n function (fn: typeof repeatedElement) {\n repeatedElementFn = fn;\n };\n","import React from \"react\";\n\nconst PlasmicLinkContext = React.createContext<\n React.ComponentType<any> | undefined\n>(undefined);\n\nexport function usePlasmicLinkMaybe():\n | React.ComponentType<React.ComponentProps<\"a\">>\n | undefined {\n return React.useContext(PlasmicLinkContext);\n}\n\nconst AnchorLink = React.forwardRef(function AnchorLink(\n props: React.ComponentProps<\"a\">,\n ref: React.Ref<HTMLAnchorElement>\n) {\n return <a {...props} ref={ref} />;\n});\n\nexport function usePlasmicLink(): React.ComponentType<\n React.ComponentProps<\"a\">\n> {\n const Link = React.useContext(PlasmicLinkContext);\n if (Link) {\n return Link;\n } else {\n return AnchorLink as React.ComponentType<React.ComponentProps<\"a\">>;\n }\n}\n\nexport function PlasmicLinkProvider(props: {\n Link: React.ComponentType<any> | undefined;\n children?: React.ReactNode;\n}) {\n const { Link, children } = props;\n return (\n <PlasmicLinkContext.Provider value={Link}>\n {children}\n </PlasmicLinkContext.Provider>\n );\n}\n","export const hostVersion = \"1.0.149\";\n","import * as PlasmicQuery from \"@plasmicapp/query\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { registerRenderErrorListener, setPlasmicRootNode } from \"./canvas-host\";\nimport * as hostModule from \"./exports\";\nimport { setRepeatedElementFn } from \"./repeatedElement\";\n// version.ts is automatically generated by `yarn build` and not committed.\nimport { hostVersion } from \"./version\";\n\n// All exports must come from \"./exports\"\nexport * from \"./exports\";\n\nconst root = globalThis as any;\n\nif (root.__Sub == null) {\n // Creating a side effect here by logging, so that vite won't\n // ignore this block for whatever reason. Hiding this for now\n // as users are complaining; will have to check if this has\n // been fixed with vite.\n // console.log(\"Plasmic: Setting up app host dependencies\");\n root.__Sub = {\n React,\n ReactDOM,\n PlasmicQuery,\n hostModule,\n hostVersion,\n hostUtils: {\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n },\n\n // For backwards compatibility:\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n ...hostModule,\n };\n}\n"],"names":["useState","useCallback","React","ReactDOM","createContext","useContext","root","isValidElement","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CA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EAAE;;;;;;IAMtB,IAAI,CAAC,KAAK,cACR,KAAK,kBAAA,EACL,QAAQ,qBAAA,EACR,YAAY,yBAAA,EACZ,UAAU,YAAA,EACV,WAAW,aAAA,EACX,SAAS,EAAE;YACT,kBAAkB,oBAAA;YAClB,2BAA2B,6BAAA;YAC3B,oBAAoB,sBAAA;SACrB;;QAGD,kBAAkB,oBAAA,EAClB,2BAA2B,6BAAA,EAC3B,oBAAoB,sBAAA,IACjB,UAAU,CACd,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../node_modules/tslib/tslib.es6.js","../src/lang-utils.ts","../src/useForceUpdate.ts","../src/canvas-host.tsx","../src/common.ts","../src/data.tsx","../src/fetcher.ts","../src/global-actions.tsx","../src/registerComponent.ts","../src/registerGlobalContext.ts","../src/registerToken.ts","../src/registerTrait.ts","../src/repeatedElement.ts","../src/link.tsx","../src/version.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","function isString(x: any): x is string {\n return typeof x === \"string\";\n}\n\ntype StringGen = string | (() => string);\n\nexport function ensure<T>(x: T | null | undefined, msg: StringGen = \"\"): T {\n if (x === null || x === undefined) {\n debugger;\n msg = (isString(msg) ? msg : msg()) || \"\";\n throw new Error(\n `Value must not be undefined or null${msg ? `- ${msg}` : \"\"}`\n );\n } else {\n return x;\n }\n}\n","import { useCallback, useState } from \"react\";\n\nexport default function useForceUpdate() {\n const [, setTick] = useState(0);\n const update = useCallback(() => {\n setTick((tick) => tick + 1);\n }, []);\n return update;\n}\n","import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { ensure } from \"./lang-utils\";\nimport useForceUpdate from \"./useForceUpdate\";\n\ndeclare global {\n interface Window {\n __PlasmicHostVersion: string;\n }\n}\n\nif ((globalThis as any).__PlasmicHostVersion == null) {\n (globalThis as any).__PlasmicHostVersion = \"3\";\n}\n\nconst rootChangeListeners: (() => void)[] = [];\nclass PlasmicRootNodeWrapper {\n constructor(private value: null | React.ReactElement) {}\n set = (val: null | React.ReactElement) => {\n this.value = val;\n rootChangeListeners.forEach((f) => f());\n };\n get = () => this.value;\n}\n\nconst plasmicRootNode = new PlasmicRootNodeWrapper(null);\n\nfunction getHashParams() {\n return new URLSearchParams(location.hash.replace(/^#/, \"?\"));\n}\n\nfunction getPlasmicOrigin() {\n const params = getHashParams();\n return ensure(\n params.get(\"origin\"),\n \"Missing information from Plasmic window.\"\n );\n}\n\nfunction getStudioHash() {\n const hashParams = getHashParams();\n if (hashParams.has(\"studioHash\")) {\n return hashParams.get(\"studioHash\");\n }\n const urlParams = new URL(location.href).searchParams;\n return urlParams.get(\"studio-hash\");\n}\n\nfunction renderStudioIntoIframe() {\n const script = document.createElement(\"script\");\n const plasmicOrigin = getPlasmicOrigin();\n const hash = getStudioHash();\n script.src = `${plasmicOrigin}/static/js/studio${\n hash ? `.${hash}.js` : `.js`\n }`;\n document.body.appendChild(script);\n}\n\nlet renderCount = 0;\nexport function setPlasmicRootNode(node: React.ReactElement | null) {\n // Keep track of renderCount, which we use as key to ErrorBoundary, so\n // we can reset the error on each render\n renderCount++;\n plasmicRootNode.set(node);\n}\n\nexport interface PlasmicCanvasContextValue {\n componentName: string | null;\n globalVariants: Record<string, string>;\n interactive?: boolean;\n}\n\n/**\n * React context to detect whether the component is rendered on Plasmic editor.\n * If not, return false.\n * If so, return an object with more information about the component\n */\nexport const PlasmicCanvasContext = React.createContext<\n PlasmicCanvasContextValue | false\n>(false);\nexport const usePlasmicCanvasContext = () =>\n React.useContext(PlasmicCanvasContext);\n\nfunction _PlasmicCanvasHost() {\n // If window.parent is null, then this is a window whose containing iframe\n // has been detached from the DOM (for the top window, window.parent === window).\n // In that case, we shouldn't do anything. If window.parent is null, by the way,\n // location.hash will also be null.\n const isFrameAttached = !!window.parent;\n const isCanvas = !!location.hash?.match(/\\bcanvas=true\\b/);\n const isLive = !!location.hash?.match(/\\blive=true\\b/) || !isFrameAttached;\n const shouldRenderStudio =\n isFrameAttached &&\n !document.querySelector(\"#plasmic-studio-tag\") &&\n !isCanvas &&\n !isLive;\n const forceUpdate = useForceUpdate();\n React.useLayoutEffect(() => {\n rootChangeListeners.push(forceUpdate);\n return () => {\n const index = rootChangeListeners.indexOf(forceUpdate);\n if (index >= 0) {\n rootChangeListeners.splice(index, 1);\n }\n };\n }, [forceUpdate]);\n React.useEffect(() => {\n if (shouldRenderStudio && isFrameAttached && window.parent !== window) {\n renderStudioIntoIframe();\n }\n }, [shouldRenderStudio, isFrameAttached]);\n React.useEffect(() => {\n if (!shouldRenderStudio && !document.querySelector(\"#getlibs\") && isLive) {\n const scriptElt = document.createElement(\"script\");\n scriptElt.id = \"getlibs\";\n scriptElt.src = getPlasmicOrigin() + \"/static/js/getlibs.js\";\n scriptElt.async = false;\n scriptElt.onload = () => {\n (window as any).__GetlibsReadyResolver?.();\n };\n document.head.append(scriptElt);\n }\n }, [shouldRenderStudio]);\n\n const [canvasContextValue, setCanvasContextValue] = React.useState(() =>\n deriveCanvasContextValue()\n );\n\n React.useEffect(() => {\n if (isCanvas) {\n const listener = () => {\n setCanvasContextValue(deriveCanvasContextValue());\n };\n window.addEventListener(\"hashchange\", listener);\n return () => window.removeEventListener(\"hashchange\", listener);\n }\n return undefined;\n }, [isCanvas]);\n if (!isFrameAttached) {\n return null;\n }\n if (isCanvas || isLive) {\n let appDiv = document.querySelector(\"#plasmic-app.__wab_user-body\");\n if (!appDiv) {\n appDiv = document.createElement(\"div\");\n appDiv.id = \"plasmic-app\";\n appDiv.classList.add(\"__wab_user-body\");\n document.body.appendChild(appDiv);\n }\n return ReactDOM.createPortal(\n <ErrorBoundary key={`${renderCount}`}>\n <PlasmicCanvasContext.Provider value={canvasContextValue}>\n {plasmicRootNode.get()}\n </PlasmicCanvasContext.Provider>\n </ErrorBoundary>,\n appDiv,\n \"plasmic-app\"\n );\n }\n if (shouldRenderStudio && window.parent === window) {\n return (\n <iframe\n src={`https://docs.plasmic.app/app-content/app-host-ready#appHostUrl=${encodeURIComponent(\n location.href\n )}`}\n style={{\n width: \"100vw\",\n height: \"100vh\",\n border: \"none\",\n position: \"fixed\",\n top: 0,\n left: 0,\n zIndex: 99999999,\n }}\n ></iframe>\n );\n }\n return null;\n}\n\ninterface PlasmicCanvasHostProps {\n /**\n * Webpack hmr uses EventSource to\tlisten to hot reloads, but that\n * resultsin a persistent\tconnection from\teach window. In Plasmic\n * Studio, if a project is configured to use app-hosting with a\n * nextjs or gatsby server running in dev mode, each artboard will\n * be holding a persistent connection to the dev server.\n * Because browsers\thave a limit to\thow many connections can\n * be held\tat a time by domain, this means\tafter X\tartboards, new\n * artboards will freeze and not load.\n *\n * By default, <PlasmicCanvasHost /> will globally mutate\n * window.EventSource to avoid using EventSource for HMR, which you\n * typically don't need for your custom host page. If you do still\n * want to retain HRM, then youc an pass enableWebpackHmr={true}.\n */\n enableWebpackHmr?: boolean;\n}\n\nexport const PlasmicCanvasHost: React.FunctionComponent<\n PlasmicCanvasHostProps\n> = (props) => {\n const { enableWebpackHmr } = props;\n const [node, setNode] = React.useState<React.ReactElement<any, any> | null>(\n null\n );\n React.useEffect(() => {\n setNode(<_PlasmicCanvasHost />);\n }, []);\n return (\n <>\n {!enableWebpackHmr && <DisableWebpackHmr />}\n {node}\n </>\n );\n};\n\ntype RenderErrorListener = (err: Error) => void;\nconst renderErrorListeners: RenderErrorListener[] = [];\nexport function registerRenderErrorListener(listener: RenderErrorListener) {\n renderErrorListeners.push(listener);\n return () => {\n const index = renderErrorListeners.indexOf(listener);\n if (index >= 0) {\n renderErrorListeners.splice(index, 1);\n }\n };\n}\n\ninterface ErrorBoundaryProps {\n children?: React.ReactNode;\n}\n\ninterface ErrorBoundaryState {\n error?: Error;\n}\n\nclass ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {};\n }\n\n static getDerivedStateFromError(error: Error) {\n return { error };\n }\n\n componentDidCatch(error: Error) {\n renderErrorListeners.forEach((listener) => listener(error));\n }\n\n render() {\n if (this.state.error) {\n return <div>Error: {`${this.state.error.message}`}</div>;\n } else {\n return <>{this.props.children}</>;\n }\n }\n}\n\nfunction DisableWebpackHmr() {\n if (process.env.NODE_ENV === \"production\") {\n return null;\n }\n return (\n <script\n type=\"text/javascript\"\n dangerouslySetInnerHTML={{\n __html: `\n if (typeof window !== \"undefined\") {\n const RealEventSource = window.EventSource;\n window.EventSource = function(url, config) {\n if (/[^a-zA-Z]hmr($|[^a-zA-Z])/.test(url)) {\n console.warn(\"Plasmic: disabled EventSource request for\", url);\n return {\n onerror() {}, onmessage() {}, onopen() {}, close() {}\n };\n } else {\n return new RealEventSource(url, config);\n }\n }\n }\n `,\n }}\n ></script>\n );\n}\n\nfunction deriveCanvasContextValue(): PlasmicCanvasContextValue | false {\n const hash = window.location.hash;\n if (hash && hash.length > 0) {\n // create URLsearchParams skipping the initial # character\n const params = new URLSearchParams(hash.substring(1));\n if (params.get(\"canvas\") === \"true\") {\n const globalVariants = params.get(\"globalVariants\");\n return {\n componentName: params.get(\"componentName\") ?? null,\n globalVariants: globalVariants ? JSON.parse(globalVariants) : {},\n interactive: params.get(\"interactive\") === \"true\",\n };\n }\n }\n return false;\n}\n","export const tuple = <T extends any[]>(...args: T): T => args;\n","import React, {\n createContext,\n ReactElement,\n ReactNode,\n useContext,\n} from \"react\";\nimport { tuple } from \"./common\";\n\nexport type DataDict = Record<string, any>;\n\nexport const DataContext = createContext<DataDict | undefined>(undefined);\n\nexport type DataMeta = {\n hidden?: boolean;\n label?: string;\n};\n\nexport function mkMetaName(name: string) {\n return `__plasmic_meta_${name}`;\n}\n\nexport function mkMetaValue(meta: Partial<DataMeta>): DataMeta {\n return meta;\n}\n\nexport function applySelector(\n rawData: DataDict | undefined,\n selector: string | undefined\n): any {\n if (!selector) {\n return undefined;\n }\n let curData = rawData;\n for (const key of selector.split(\".\")) {\n curData = curData?.[key];\n }\n return curData;\n}\n\nexport type SelectorDict = Record<string, string | undefined>;\n\nexport function useSelector(selector: string | undefined): any {\n const rawData = useDataEnv();\n return applySelector(rawData, selector);\n}\n\nexport function useSelectors(selectors: SelectorDict = {}): any {\n const rawData = useDataEnv();\n return Object.fromEntries(\n Object.entries(selectors)\n .filter(([key, selector]) => !!key && !!selector)\n .map(([key, selector]) => tuple(key, applySelector(rawData, selector)))\n );\n}\n\nexport function useDataEnv() {\n return useContext(DataContext);\n}\n\nexport interface DataProviderProps {\n /**\n * Key to set in data context.\n */\n name?: string;\n /**\n * Value to set for `name` in data context.\n */\n data?: any;\n /**\n * If true, hide this entry in studio (data binding).\n */\n hidden?: boolean;\n /**\n * Label to be shown in the studio data picker for easier navigation (data binding).\n */\n label?: string;\n children?: ReactNode;\n}\n\nexport function DataProvider({\n name,\n data,\n hidden,\n label,\n children,\n}: DataProviderProps) {\n const existingEnv = useDataEnv() ?? {};\n if (!name) {\n return <>{children}</>;\n } else {\n return (\n <DataContext.Provider\n value={{\n ...existingEnv,\n [name]: data,\n [mkMetaName(name)]: mkMetaValue({ hidden, label }),\n }}\n >\n {children}\n </DataContext.Provider>\n );\n }\n}\n\nexport interface PageParamsProviderProps {\n params?: Record<string, string | string[] | undefined>;\n query?: Record<string, string | string[] | undefined>;\n children?: ReactNode;\n}\n\nexport function PageParamsProvider({\n children,\n params = {},\n query = {},\n}: PageParamsProviderProps) {\n const $ctx = useDataEnv() || {};\n return (\n <DataProvider\n name={\"params\"}\n data={{ ...$ctx.params, ...params }}\n label={\"Page URL path params\"}\n >\n <DataProvider\n name={\"query\"}\n data={{ ...$ctx.query, ...query }}\n label={\"Page URL query params\"}\n >\n {children}\n </DataProvider>\n </DataProvider>\n );\n}\n\nexport function DataCtxReader({\n children,\n}: {\n children: ($ctx: DataDict | undefined) => ReactNode;\n}) {\n const $ctx = useDataEnv();\n return children($ctx) as ReactElement | null;\n}\n","import { PrimitiveType } from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport type Fetcher = (...args: any[]) => Promise<any>;\n\nexport interface FetcherMeta {\n /**\n * Any unique identifying string for this fetcher.\n */\n name: string;\n /**\n * The Studio-user-friendly display name.\n */\n displayName?: string;\n /**\n * The symbol to import from the importPath.\n */\n importName?: string;\n args: { name: string; type: PrimitiveType }[];\n returns: PrimitiveType;\n /**\n * Either the path to the fetcher relative to `rootDir` or the npm\n * package name\n */\n importPath: string;\n /**\n * Whether it's a default export or named export\n */\n isDefaultExport?: boolean;\n}\n\nexport interface FetcherRegistration {\n fetcher: Fetcher;\n meta: FetcherMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicFetcherRegistry: FetcherRegistration[];\n }\n}\n\nroot.__PlasmicFetcherRegistry = [];\n\nexport function registerFetcher(fetcher: Fetcher, meta: FetcherMeta) {\n root.__PlasmicFetcherRegistry.push({ fetcher, meta });\n}\n","import React from \"react\";\n\nexport type GlobalActionDict = Record<string, Function>;\n\nexport const GlobalActionsContext = React.createContext<\n GlobalActionDict | undefined\n>(undefined);\n\nexport function GlobalActionsProvider(props: {\n contextName: string;\n children?: React.ReactNode;\n actions: GlobalActionDict;\n}) {\n const { contextName, children, actions } = props;\n const namespacedActions = React.useMemo(\n () =>\n Object.fromEntries(\n Object.entries(actions).map(([key, val]) => [\n `${contextName}.${key}`,\n val,\n ])\n ),\n [contextName, actions]\n );\n return (\n <GlobalActionsContext.Provider value={namespacedActions}>\n {children}\n </GlobalActionsContext.Provider>\n );\n}\n\nexport function useGlobalActions() {\n return React.useContext(GlobalActionsContext) ?? {};\n}\n","import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n onMutate?: (stateValue: T, $ref: any) => void;\n}\n\n// A compile-time error will occur if a new field is added to the StateHelper \n// interface but not included in the keys array of state helper.\ntype TupleUnion<U extends string, R extends string[] = []> = {\n [S in U]: Exclude<U, S> extends never\n ? [...R, S]\n : TupleUnion<Exclude<U, S>, [...R, S]>;\n}[U] &\n string[];\n\nexport const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>> = [\n \"initFunc\",\n \"onChangeArgsToValue\",\n \"onMutate\",\n];\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n","import {\n BooleanType,\n ChoiceType,\n CustomType,\n JSONLikeType,\n NumberType,\n StringType,\n DataSourceType,\n} from \"./prop-types\";\nimport { FunctionParam } from \"./registerComponent\";\n\nconst root = globalThis as any;\n\n// Using just a subset of types from prop-types\nexport type PropType<P> =\n | StringType<P>\n | BooleanType<P>\n | NumberType<P>\n | JSONLikeType<P>\n | ChoiceType<P>\n | CustomType<P>\n | DataSourceType<P>;\n\ntype RestrictPropType<T, P> = T extends string\n ? StringType<P> | ChoiceType<P> | JSONLikeType<P> | CustomType<P>\n : T extends boolean\n ? BooleanType<P> | JSONLikeType<P> | CustomType<P>\n : T extends number\n ? NumberType<P> | JSONLikeType<P> | CustomType<P>\n : PropType<P>;\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\nexport interface GlobalContextMeta<P> {\n /**\n * Any unique string name used to identify that context. Each context\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the context in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the context to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the context properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * The path to be used when importing the context in the generated code.\n * It can be the name of the package that contains the context, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the context is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Whether the global context provides data to its children using DataProvider.\n */\n providesData?: boolean;\n\n unstable__globalActions?: Record<string, GlobalActionRegistration<P>>;\n}\n\nexport interface GlobalContextRegistration {\n component: React.ComponentType<any>;\n meta: GlobalContextMeta<any>;\n}\n\nexport interface GlobalActionRegistration<P> {\n displayName?: string;\n description?: string;\n parameters: FunctionParam<P>[];\n}\n\ndeclare global {\n interface Window {\n __PlasmicContextRegistry: GlobalContextRegistration[];\n }\n}\n\nif (root.__PlasmicContextRegistry == null) {\n root.__PlasmicContextRegistry = [];\n}\n\nexport default function registerGlobalContext<\n T extends React.ComponentType<any>\n>(component: T, meta: GlobalContextMeta<React.ComponentProps<T>>) {\n // Check for duplicates\n if (\n root.__PlasmicContextRegistry.some(\n (r: GlobalContextRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicContextRegistry.push({ component, meta });\n}\n","export type TokenType =\n | \"color\"\n | \"spacing\"\n | \"font-family\"\n | \"font-size\"\n | \"line-height\"\n | \"opacity\";\n\nexport interface TokenRegistration {\n name: string;\n displayName: string;\n value: string;\n type: TokenType;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTokenRegistry: TokenRegistration[];\n }\n}\n\nconst root = globalThis as any;\n\nif (root.__PlasmicTokenRegistry == null) {\n root.__PlasmicTokenRegistry = [];\n}\n\nexport default function registerToken(token: TokenRegistration) {\n root.__PlasmicTokenRegistry.push(token);\n}\n","const root = globalThis as any;\n\nexport interface BasicTrait {\n label?: string;\n type: \"text\" | \"number\" | \"boolean\";\n}\n\nexport interface ChoiceTrait {\n label?: string;\n type: \"choice\";\n options: string[];\n}\n\nexport type TraitMeta = BasicTrait | ChoiceTrait;\n\nexport interface TraitRegistration {\n trait: string;\n meta: TraitMeta;\n}\n\ndeclare global {\n interface Window {\n __PlasmicTraitRegistry: TraitRegistration[];\n }\n}\n\nif (root.__PlasmicTraitRegistry == null) {\n root.__PlasmicTraitRegistry = [];\n}\n\nexport default function registerTrait(trait: string, meta: TraitMeta) {\n root.__PlasmicTraitRegistry.push({\n trait,\n meta,\n });\n}\n","import { cloneElement, isValidElement } from \"react\";\n\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param index The index of the copy (starting at 0).\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(index: number, elt: T): T;\n/**\n * Allows elements to be repeated in Plasmic Studio.\n * @param isPrimary should be true for at most one instance of the element, and\n * indicates which copy of the element will be highlighted when the element is\n * selected in Studio.\n * @param elt the React element to be repeated (or an array of such).\n */\nexport default function repeatedElement<T>(isPrimary: boolean, elt: T): T;\nexport default function repeatedElement<T>(index: boolean | number, elt: T): T {\n return repeatedElementFn(index as any, elt);\n}\n\nlet repeatedElementFn: typeof repeatedElement = (\n index: boolean | number,\n elt: any\n) => {\n if (Array.isArray(elt)) {\n return elt.map((v) => repeatedElementFn(index as any, v)) as any;\n }\n if (elt && isValidElement(elt) && typeof elt !== \"string\") {\n return cloneElement(elt) as any;\n }\n return elt;\n};\n\nconst root = globalThis as any;\nexport const setRepeatedElementFn: (fn: typeof repeatedElement) => void =\n root?.__Sub?.setRepeatedElementFn ??\n function (fn: typeof repeatedElement) {\n repeatedElementFn = fn;\n };\n","import React from \"react\";\n\nconst PlasmicLinkContext = React.createContext<\n React.ComponentType<any> | undefined\n>(undefined);\n\nexport function usePlasmicLinkMaybe():\n | React.ComponentType<React.ComponentProps<\"a\">>\n | undefined {\n return React.useContext(PlasmicLinkContext);\n}\n\nconst AnchorLink = React.forwardRef(function AnchorLink(\n props: React.ComponentProps<\"a\">,\n ref: React.Ref<HTMLAnchorElement>\n) {\n return <a {...props} ref={ref} />;\n});\n\nexport function usePlasmicLink(): React.ComponentType<\n React.ComponentProps<\"a\">\n> {\n const Link = React.useContext(PlasmicLinkContext);\n if (Link) {\n return Link;\n } else {\n return AnchorLink as React.ComponentType<React.ComponentProps<\"a\">>;\n }\n}\n\nexport function PlasmicLinkProvider(props: {\n Link: React.ComponentType<any> | undefined;\n children?: React.ReactNode;\n}) {\n const { Link, children } = props;\n return (\n <PlasmicLinkContext.Provider value={Link}>\n {children}\n </PlasmicLinkContext.Provider>\n );\n}\n","export const hostVersion = \"1.0.150\";\n","import * as PlasmicQuery from \"@plasmicapp/query\";\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { registerRenderErrorListener, setPlasmicRootNode } from \"./canvas-host\";\nimport * as hostModule from \"./exports\";\nimport { setRepeatedElementFn } from \"./repeatedElement\";\n// version.ts is automatically generated by `yarn build` and not committed.\nimport { hostVersion } from \"./version\";\n\n// All exports must come from \"./exports\"\nexport * from \"./exports\";\n\nconst root = globalThis as any;\n\nif (root.__Sub == null) {\n // Creating a side effect here by logging, so that vite won't\n // ignore this block for whatever reason. Hiding this for now\n // as users are complaining; will have to check if this has\n // been fixed with vite.\n // console.log(\"Plasmic: Setting up app host dependencies\");\n root.__Sub = {\n React,\n ReactDOM,\n PlasmicQuery,\n hostModule,\n hostVersion,\n hostUtils: {\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n },\n\n // For backwards compatibility:\n setPlasmicRootNode,\n registerRenderErrorListener,\n setRepeatedElementFn,\n ...hostModule,\n };\n}\n"],"names":["useState","useCallback","React","ReactDOM","createContext","useContext","root","isValidElement","cloneElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,C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BAAA;YAC3B,oBAAoB,sBAAA;SACrB;;QAGD,kBAAkB,oBAAA,EAClB,2BAA2B,6BAAA,EAC3B,oBAAoB,sBAAA,IACjB,UAAU,CACd,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/prop-types.d.ts
CHANGED
|
@@ -259,15 +259,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
259
|
dataSource: "airtable" | "cms";
|
|
260
260
|
}
|
|
261
261
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
262
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
263
|
type: "dataSelector";
|
|
264
|
-
data
|
|
264
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
265
|
alwaysShowValuePathAsLabel?: boolean;
|
|
266
|
+
mergeWithExternalData?: boolean;
|
|
266
267
|
}
|
|
267
|
-
|
|
268
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
269
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
270
|
type: "exprEditor";
|
|
269
|
-
data
|
|
271
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
270
273
|
}
|
|
274
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
275
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
276
|
type: "formValidationRules";
|
|
273
277
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.150";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/host",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.150",
|
|
4
4
|
"description": "plasmic library for app hosting",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@plasmicapp/query": "0.1.67",
|
|
57
|
+
"csstype": "^3.0.8",
|
|
57
58
|
"window-or-global": "^1.0.1"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
@@ -65,7 +66,6 @@
|
|
|
65
66
|
"@types/node": "^14.0.26",
|
|
66
67
|
"@types/react": "^18.0.27",
|
|
67
68
|
"@types/react-dom": "^18.0.10",
|
|
68
|
-
"csstype": "^3.0.8",
|
|
69
69
|
"react": "^18.2.0",
|
|
70
70
|
"react-dom": "^18.2.0",
|
|
71
71
|
"rollup": "^2.47.0",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"react": ">=16.8.0",
|
|
81
81
|
"react-dom": ">=16.8.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "d933fd1793c7b2d01af2400582593724ec364085"
|
|
84
84
|
}
|
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var root = globalThis;
|
|
7
|
+
var stateHelpersKeys = [
|
|
8
|
+
"initFunc",
|
|
9
|
+
"onChangeArgsToValue",
|
|
10
|
+
"onMutate",
|
|
11
|
+
];
|
|
7
12
|
if (root.__PlasmicComponentRegistry == null) {
|
|
8
13
|
root.__PlasmicComponentRegistry = [];
|
|
9
14
|
}
|
|
@@ -18,4 +23,5 @@ function registerComponent(component, meta) {
|
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
exports['default'] = registerComponent;
|
|
26
|
+
exports.stateHelpersKeys = stateHelpersKeys;
|
|
21
27
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../../src/registerComponent.ts"],"sourcesContent":["import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n}\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n"],"names":[],"mappings":";;;;;AAoBA,IAAM,IAAI,GAAG,UAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../src/registerComponent.ts"],"sourcesContent":["import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n onMutate?: (stateValue: T, $ref: any) => void;\n}\n\n// A compile-time error will occur if a new field is added to the StateHelper \n// interface but not included in the keys array of state helper.\ntype TupleUnion<U extends string, R extends string[] = []> = {\n [S in U]: Exclude<U, S> extends never\n ? [...R, S]\n : TupleUnion<Exclude<U, S>, [...R, S]>;\n}[U] &\n string[];\n\nexport const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>> = [\n \"initFunc\",\n \"onChangeArgsToValue\",\n \"onMutate\",\n];\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n"],"names":[],"mappings":";;;;;AAoBA,IAAM,IAAI,GAAG,UAAiB,CAAC;IAwGlB,gBAAgB,GAA6C;IACxE,UAAU;IACV,qBAAqB;IACrB,UAAU;EACV;AA2LF,IAAI,IAAI,CAAC,0BAA0B,IAAI,IAAI,EAAE;IAC3C,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;CACtC;SAEuB,iBAAiB,CACvC,SAAY,EACZ,IAAgD;;IAGhD,IACE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAClC,UAAC,CAAwB;QACvB,OAAA,CAAC,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;KAAA,CACzD,EACD;QACA,OAAO;KACR;IACD,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,SAAS,WAAA,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;AAC5D;;;;;"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
var root = globalThis;
|
|
3
|
+
var stateHelpersKeys = [
|
|
4
|
+
"initFunc",
|
|
5
|
+
"onChangeArgsToValue",
|
|
6
|
+
"onMutate",
|
|
7
|
+
];
|
|
3
8
|
if (root.__PlasmicComponentRegistry == null) {
|
|
4
9
|
root.__PlasmicComponentRegistry = [];
|
|
5
10
|
}
|
|
@@ -13,5 +18,5 @@ function registerComponent(component, meta) {
|
|
|
13
18
|
root.__PlasmicComponentRegistry.push({ component: component, meta: meta });
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
export { registerComponent as default };
|
|
21
|
+
export { registerComponent as default, stateHelpersKeys };
|
|
17
22
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../../src/registerComponent.ts"],"sourcesContent":["import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n}\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n"],"names":[],"mappings":";AAoBA,IAAM,IAAI,GAAG,UAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/registerComponent.ts"],"sourcesContent":["import {\n CodeComponentElement,\n CSSProperties,\n PlasmicElement,\n} from \"./element-types\";\nimport {\n ContextDependentConfig,\n InferDataType,\n ModalProps,\n PropType,\n RestrictPropType,\n} from \"./prop-types\";\nexport type {\n CanvasComponentProps,\n ControlExtras,\n ControlContext,\n ContextDependentConfig,\n PropType,\n} from \"./prop-types\";\n\nconst root = globalThis as any;\n\nexport interface ActionProps<P> {\n componentProps: P;\n /**\n * `contextData` can be `null` if the prop controls are rendering before\n * the component instance itself (it will re-render once the component\n * calls `setControlContextData`)\n */\n contextData: InferDataType<P> | null;\n studioOps: {\n showModal: (\n modalProps: Omit<ModalProps, \"onClose\"> & { onClose?: () => void }\n ) => void;\n refreshQueryData: () => void;\n appendToSlot: (element: PlasmicElement, slotName: string) => void;\n removeFromSlotAt: (pos: number, slotName: string) => void;\n updateProps: (newValues: any) => void;\n };\n /**\n * The document that the component will be rendered into; instead of using\n * `document` directly (for, say, `document.querySelector()` etc.), you\n * should use this instead.\n */\n studioDocument: typeof document;\n}\n\nexport type Action<P> =\n | {\n type: \"button-action\";\n label: string;\n onClick: (props: ActionProps<P>) => void;\n hidden?: ContextDependentConfig<P, boolean>;\n }\n | {\n type: \"custom-action\";\n control: React.ComponentType<ActionProps<P>>;\n hidden?: ContextDependentConfig<P, boolean>;\n };\n\ntype DistributedKeyOf<T> = T extends any ? keyof T : never;\n\ninterface ComponentTemplate<P>\n extends Omit<CodeComponentElement<P>, \"type\" | \"name\"> {\n /**\n * A preview picture for the template.\n */\n previewImg?: string;\n}\n\nexport interface ComponentTemplates<P> {\n [name: string]: ComponentTemplate<P>;\n}\n\nexport type StateSpec = {\n onChangeProp: string;\n} & (\n | {\n type: \"readonly\";\n variableType: \"text\";\n initVal?: string;\n }\n | {\n type: \"readonly\";\n variableType: \"number\";\n initVal?: number;\n }\n | {\n type: \"readonly\";\n variableType: \"boolean\";\n initVal?: boolean;\n }\n | {\n type: \"readonly\";\n variableType: \"array\";\n initVal?: any[];\n }\n | {\n type: \"readonly\";\n variableType: \"object\";\n initVal?: object;\n }\n | {\n type: \"writable\";\n variableType: \"text\" | \"number\" | \"boolean\" | \"array\" | \"object\";\n valueProp: string;\n }\n);\n\nexport interface StateHelpers<P, T> {\n initFunc?: ($props: P) => T;\n onChangeArgsToValue?: (...args: any) => T;\n onMutate?: (stateValue: T, $ref: any) => void;\n}\n\n// A compile-time error will occur if a new field is added to the StateHelper \n// interface but not included in the keys array of state helper.\ntype TupleUnion<U extends string, R extends string[] = []> = {\n [S in U]: Exclude<U, S> extends never\n ? [...R, S]\n : TupleUnion<Exclude<U, S>, [...R, S]>;\n}[U] &\n string[];\n\nexport const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>> = [\n \"initFunc\",\n \"onChangeArgsToValue\",\n \"onMutate\",\n];\n\nexport type ComponentHelpers<P> = {\n states: Record<string, StateHelpers<P, any>>;\n};\n\nexport type ExternalComponentHelpers<P> = {\n helpers: ComponentHelpers<P>;\n importPath: string;\n} & (\n | {\n importName: string;\n }\n | {\n isDefaultExport: true;\n }\n);\n\nexport type StyleSection =\n | \"visibility\"\n | \"typography\"\n | \"sizing\"\n | \"spacing\"\n | \"background\"\n | \"transform\"\n | \"transitions\"\n | \"layout\"\n | \"overflow\"\n | \"border\"\n | \"shadows\"\n | \"effects\";\n\nexport interface CodeComponentMeta<P> {\n /**\n * Any unique string name used to identify that component. Each component\n * should be registered with a different `meta.name`, even if they have the\n * same name in the code.\n */\n name: string;\n /**\n * The name to be displayed for the component in Studio. Optional: if not\n * specified, `meta.name` is used.\n */\n displayName?: string;\n /**\n * The description of the component to be shown in Studio.\n */\n description?: string;\n /**\n * The javascript name to be used when generating code. Optional: if not\n * provided, `meta.name` is used.\n */\n importName?: string;\n /**\n * An object describing the component properties to be used in Studio.\n * For each `prop`, there should be an entry `meta.props[prop]` describing\n * its type.\n */\n props: { [prop in DistributedKeyOf<P>]?: RestrictPropType<P[prop], P> } & {\n [prop: string]: PropType<P>;\n };\n /**\n * An object describing the component states to be used in Studio.\n */\n states?: Record<string, StateSpec>;\n /**\n * An object describing the components helpers to be used in Studio.\n * 1. states helpers: Each state can receive an \"initFunc\" prop to initialize\n * the implicit state in Studio, and an \"onChangeArgsToValue\" prop to\n * transform the event handler arguments into a value\n */\n componentHelpers?: ExternalComponentHelpers<P>;\n /**\n * An array describing the component actions to be used in Studio.\n */\n actions?: Action<P>[];\n /**\n * Whether style sections should be shown in Studio. For styles to work, the\n * component must accept a `className` prop. If unset, defaults to all styles.\n * Set to `false` if this component cannot be styled (for example, if it doesn't\n * render any DOM elements).\n */\n styleSections?: StyleSection[] | boolean;\n /**\n * Whether the element can be repeated in Studio. If unset, defaults to true.\n */\n isRepeatable?: boolean;\n /**\n * The path to be used when importing the component in the generated code.\n * It can be the name of the package that contains the component, or the path\n * to the file in the project (relative to the root directory).\n */\n importPath: string;\n /**\n * Whether the component is the default export from that path. Optional: if\n * not specified, it's considered `false`.\n */\n isDefaultExport?: boolean;\n /**\n * The prop that expects the CSS classes with styles to be applied to the\n * component. Optional: if not specified, Plasmic will expect it to be\n * `className`. Notice that if the component does not accept CSS classes, the\n * component will not be able to receive styles from the Studio.\n */\n classNameProp?: string;\n /**\n * The prop that receives and forwards a React `ref`. Plasmic only uses `ref`\n * to interact with components, so it's not used in the generated code.\n * Optional: If not provided, the usual `ref` is used.\n */\n refProp?: string;\n /**\n * Default styles to start with when instantiating the component in Plasmic.\n */\n defaultStyles?: CSSProperties;\n /**\n * Component templates to start with on Plasmic.\n */\n templates?: ComponentTemplates<P>;\n /**\n * Registered name of parent component, used for grouping related components.\n */\n parentComponentName?: string;\n /**\n * Whether the component can be used as an attachment to an element.\n */\n isAttachment?: boolean;\n /**\n * Whether the component provides data to its slots using DataProvider.\n */\n providesData?: boolean;\n\n /**\n * If specified, then Figma components with the specified names will be mapped\n * to this component when you paste Figma content into Plasmic\n */\n figmaMappings?: {\n figmaComponentName: string;\n }[];\n\n /**\n * If true, when an instance of this component is added, the element\n * will always be named by the name of this component.\n */\n alwaysAutoName?: boolean;\n\n /**\n * If true, then won't be listed in the insert menu for content creators.\n */\n hideFromContentCreators?: boolean;\n\n refActions?: Record<string, RefActionRegistration<P>>;\n}\n\nexport type CodeComponentMode =\n | \"advanced\"\n | \"simplified\"\n | \"database-schema-driven\";\n\n/**\n * @deprecated use CodeComponentMeta instead\n */\nexport type ComponentMeta<P> = CodeComponentMeta<P>;\n\nexport interface FunctionParam<P> {\n name: string;\n displayName?: string;\n type: PropType<P>;\n}\n\nexport interface RefActionRegistration<P> {\n displayName?: string;\n description?: string;\n argTypes: FunctionParam<P>[];\n}\n\nexport interface ComponentRegistration {\n component: React.ComponentType<any>;\n meta: CodeComponentMeta<any>;\n}\n\ndeclare global {\n interface Window {\n __PlasmicComponentRegistry: ComponentRegistration[];\n }\n}\n\nif (root.__PlasmicComponentRegistry == null) {\n root.__PlasmicComponentRegistry = [];\n}\n\nexport default function registerComponent<T extends React.ComponentType<any>>(\n component: T,\n meta: CodeComponentMeta<React.ComponentProps<T>>\n) {\n // Check for duplicates\n if (\n root.__PlasmicComponentRegistry.some(\n (r: ComponentRegistration) =>\n r.component === component && r.meta.name === meta.name\n )\n ) {\n return;\n }\n root.__PlasmicComponentRegistry.push({ component, meta });\n}\n"],"names":[],"mappings":";AAoBA,IAAM,IAAI,GAAG,UAAiB,CAAC;IAwGlB,gBAAgB,GAA6C;IACxE,UAAU;IACV,qBAAqB;IACrB,UAAU;EACV;AA2LF,IAAI,IAAI,CAAC,0BAA0B,IAAI,IAAI,EAAE;IAC3C,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;CACtC;SAEuB,iBAAiB,CACvC,SAAY,EACZ,IAAgD;;IAGhD,IACE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAClC,UAAC,CAAwB;QACvB,OAAA,CAAC,CAAC,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;KAAA,CACzD,EACD;QACA,OAAO;KACR;IACD,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,SAAS,WAAA,EAAE,IAAI,MAAA,EAAE,CAAC,CAAC;AAC5D;;;;"}
|
|
@@ -259,15 +259,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
259
|
dataSource: "airtable" | "cms";
|
|
260
260
|
}
|
|
261
261
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
262
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
263
|
type: "dataSelector";
|
|
264
|
-
data
|
|
264
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
265
|
alwaysShowValuePathAsLabel?: boolean;
|
|
266
|
+
mergeWithExternalData?: boolean;
|
|
266
267
|
}
|
|
267
|
-
|
|
268
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
269
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
270
|
type: "exprEditor";
|
|
269
|
-
data
|
|
271
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
270
273
|
}
|
|
274
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
275
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
276
|
type: "formValidationRules";
|
|
273
277
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.150";
|
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -259,15 +259,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
259
|
dataSource: "airtable" | "cms";
|
|
260
260
|
}
|
|
261
261
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
262
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
263
|
type: "dataSelector";
|
|
264
|
-
data
|
|
264
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
265
|
alwaysShowValuePathAsLabel?: boolean;
|
|
266
|
+
mergeWithExternalData?: boolean;
|
|
266
267
|
}
|
|
267
|
-
|
|
268
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
269
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
270
|
type: "exprEditor";
|
|
269
|
-
data
|
|
271
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
270
273
|
}
|
|
274
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
275
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
276
|
type: "formValidationRules";
|
|
273
277
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.150";
|
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -259,15 +259,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
259
|
dataSource: "airtable" | "cms";
|
|
260
260
|
}
|
|
261
261
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
262
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
263
|
type: "dataSelector";
|
|
264
|
-
data
|
|
264
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
265
|
alwaysShowValuePathAsLabel?: boolean;
|
|
266
|
+
mergeWithExternalData?: boolean;
|
|
266
267
|
}
|
|
267
|
-
|
|
268
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
269
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
270
|
type: "exprEditor";
|
|
269
|
-
data
|
|
271
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
270
273
|
}
|
|
274
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
275
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
276
|
type: "formValidationRules";
|
|
273
277
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.150";
|
|
@@ -3,7 +3,7 @@ export * from "./data";
|
|
|
3
3
|
export { PlasmicElement } from "./element-types";
|
|
4
4
|
export { registerFetcher as unstable_registerFetcher } from "./fetcher";
|
|
5
5
|
export * from "./global-actions";
|
|
6
|
-
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
6
|
+
export { Action, ActionProps, CodeComponentMeta, ComponentHelpers, ComponentMeta, ComponentRegistration, ComponentTemplates, default as registerComponent, stateHelpersKeys, StateHelpers, StateSpec, CodeComponentMode, } from "./registerComponent";
|
|
7
7
|
export { PropType, ContextDependentConfig } from "./prop-types";
|
|
8
8
|
export { default as registerGlobalContext, GlobalContextMeta, GlobalContextRegistration, PropType as GlobalContextPropType, } from "./registerGlobalContext";
|
|
9
9
|
export { default as registerToken, TokenRegistration, TokenType, } from "./registerToken";
|
|
@@ -259,15 +259,19 @@ export interface DataSourceType<P> extends PropTypeBase<P> {
|
|
|
259
259
|
dataSource: "airtable" | "cms";
|
|
260
260
|
}
|
|
261
261
|
type DataPickerValueType = string | number | (string | number)[];
|
|
262
|
-
interface
|
|
262
|
+
interface RichDataPickerType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
263
263
|
type: "dataSelector";
|
|
264
|
-
data
|
|
264
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
265
265
|
alwaysShowValuePathAsLabel?: boolean;
|
|
266
|
+
mergeWithExternalData?: boolean;
|
|
266
267
|
}
|
|
267
|
-
|
|
268
|
+
type DataPickerType<P> = "dataPicker" | RichDataPickerType<P>;
|
|
269
|
+
interface RichExprEditorType<P> extends PropTypeBaseDefault<P, DataPickerValueType> {
|
|
268
270
|
type: "exprEditor";
|
|
269
|
-
data
|
|
271
|
+
data?: Record<string, any> | ContextDependentConfig<P, Record<string, any>>;
|
|
272
|
+
mergeWithExternalData?: boolean;
|
|
270
273
|
}
|
|
274
|
+
type ExprEditorType<P> = "exprEditor" | RichExprEditorType<P>;
|
|
271
275
|
interface FormValidationRulesType<P> extends PropTypeBaseDefault<P, any> {
|
|
272
276
|
type: "formValidationRules";
|
|
273
277
|
}
|
|
@@ -76,7 +76,12 @@ export type StateSpec = {
|
|
|
76
76
|
export interface StateHelpers<P, T> {
|
|
77
77
|
initFunc?: ($props: P) => T;
|
|
78
78
|
onChangeArgsToValue?: (...args: any) => T;
|
|
79
|
+
onMutate?: (stateValue: T, $ref: any) => void;
|
|
79
80
|
}
|
|
81
|
+
type TupleUnion<U extends string, R extends string[] = []> = {
|
|
82
|
+
[S in U]: Exclude<U, S> extends never ? [...R, S] : TupleUnion<Exclude<U, S>, [...R, S]>;
|
|
83
|
+
}[U] & string[];
|
|
84
|
+
export declare const stateHelpersKeys: TupleUnion<keyof StateHelpers<any, any>>;
|
|
80
85
|
export type ComponentHelpers<P> = {
|
|
81
86
|
states: Record<string, StateHelpers<P, any>>;
|
|
82
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const hostVersion = "1.0.
|
|
1
|
+
export declare const hostVersion = "1.0.150";
|