twenty-sdk 2.30.0 → 2.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/index.cjs +20 -1
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.mjs +2380 -18
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{catalog-sync-WmgvkRw7.mjs → catalog-sync-Ch6nB5uf.mjs} +1 -1
- package/dist/catalog-sync-yH3B_al1.js +1 -0
- package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/front-components-watcher.d.ts +40 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/build-shared-dependencies-bundle.d.ts +8 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/create-shared-dependencies-shim-plugin.d.ts +3 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/types/shared-dependencies-build-context.type.d.ts +4 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/types/shared-dependencies-export-names.type.d.ts +4 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/enumerate-shared-dependencies-export-names.d.ts +5 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-entry-source.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-namespace-collisions.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-shim-source.d.ts +5 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/to-shared-dependencies-namespace-identifier.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/utils/get-front-component-build-plugins.d.ts +2 -0
- package/dist/cli/utilities/build/manifest/utils/extract-front-component-shared-dependencies.d.ts +5 -0
- package/dist/cli/utilities/build/manifest/utils/normalize-front-component-shared-dependencies.d.ts +1 -0
- package/dist/cli.cjs +36 -36
- package/dist/cli.mjs +2147 -2051
- package/dist/define/index.cjs +24 -24
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +328 -844
- package/dist/define/index.mjs +6645 -6513
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +3 -3
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.mjs +460 -460
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/front-component-renderer/build.cjs +1 -1
- package/dist/front-component-renderer/build.mjs +1 -1
- package/dist/get-front-component-build-plugins-C-Webbfn.js +196 -0
- package/dist/get-front-component-build-plugins-DA62IZes.mjs +9849 -0
- package/dist/{get-function-input-schema-GNk3NRLJ-DkTcUzrb.mjs → get-function-input-schema-GNk3NRLJ-C5HXalke.mjs} +1 -1
- package/dist/get-function-input-schema-GNk3NRLJ-DwfXUGPz.js +1 -0
- package/dist/logic-function/index.cjs +26 -7
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.mjs +2420 -56
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-BnGCnmge.mjs → login-BHgUJK94.mjs} +5750 -15164
- package/dist/login-BzHQgxeV.js +343 -0
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +1 -1
- package/dist/utils/index.cjs +20 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2375 -13
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/catalog-sync-61JsVcDP.js +0 -1
- package/dist/get-front-component-build-plugins-B5IvUvSS.mjs +0 -133
- package/dist/get-front-component-build-plugins-TJrFS3_p.js +0 -172
- package/dist/get-function-input-schema-GNk3NRLJ-D8x7FINz.js +0 -1
- package/dist/isDefined-Dtu5EYqP-Dp026Ry1.js +0 -1
- package/dist/login-CM2Aug-k.js +0 -365
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twenty-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"twenty": "dist/cli.cjs"
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"semver": "7.6.3",
|
|
84
84
|
"sharp": "^0.35.3",
|
|
85
85
|
"tinyglobby": "^0.2.15",
|
|
86
|
-
"twenty-client-sdk": "2.
|
|
86
|
+
"twenty-client-sdk": "2.31.0",
|
|
87
87
|
"typescript": "^5.9.3",
|
|
88
88
|
"uuid": "^13.0.2"
|
|
89
89
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./get-front-component-build-plugins-TJrFS3_p.js"),t=require("./login-CM2Aug-k.js");let n=require("chalk");n=e.i(n);var r=class{async execute(e){e.remote&&t.U.setActiveRemote(e.remote);let r=t.U.getActiveRemote();console.log(n.default.blue(`Syncing marketplace catalog on ${r}...`));let i=await new t.z().syncMarketplaceCatalog();i.success||(console.error(n.default.red(`Catalog sync failed: ${i.error instanceof Error?i.error.message:String(i.error)}`)),process.exit(1)),console.log(n.default.green(`✓ Marketplace catalog synced successfully`))}};exports.CatalogSyncCommand=r;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { createRequire as e } from "node:module";
|
|
2
|
-
import { fileURLToPath as t } from "node:url";
|
|
3
|
-
import { dirname as n } from "node:path";
|
|
4
|
-
e(import.meta.url), n(t(import.meta.url));
|
|
5
|
-
import r from "path";
|
|
6
|
-
import { readFile as i, writeFile as a } from "node:fs/promises";
|
|
7
|
-
//#region src/cli/utilities/build/common/front-component-build/css-injection-plugin.ts
|
|
8
|
-
var o = (e) => `if (typeof document !== 'undefined') {
|
|
9
|
-
const styleElement = document.createElement('style');
|
|
10
|
-
document.head.appendChild(styleElement);
|
|
11
|
-
styleElement.textContent = ${JSON.stringify(e)};
|
|
12
|
-
}`, s = {
|
|
13
|
-
name: "css-injection",
|
|
14
|
-
setup: (e) => {
|
|
15
|
-
e.onLoad({ filter: /\.css$/ }, async ({ path: e }) => ({
|
|
16
|
-
contents: o(await i(e, "utf8")),
|
|
17
|
-
loader: "js"
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
}, c = "export var customElementMap = globalThis.__HTML_TAG_TO_CUSTOM_ELEMENT_TAG__ || {};\n\nvar _injectedStyleKeys = {};\n\nexport function injectStyleViaHead(cssText) {\n if (!cssText) return;\n var hash = 0;\n for (var i = 0; i < cssText.length; i++) {\n hash = ((hash << 5) - hash + cssText.charCodeAt(i)) | 0;\n }\n var key = 'jsx-style-' + hash;\n if (_injectedStyleKeys[key]) return;\n _injectedStyleKeys[key] = true;\n var el = document.createElement('style');\n el.setAttribute('data-jsx-style', key);\n el.textContent = cssText;\n document.head.appendChild(el);\n}\n\nexport function extractCssText(children) {\n if (typeof children === 'string') return children;\n if (Array.isArray(children))\n return children\n .filter(function (c) { return typeof c === 'string'; })\n .join('');\n return '';\n}\n\nvar _reactToDomEvent = {\n ondoubleclick: 'ondblclick',\n};\n\nfunction _isEventProp(name) {\n return (\n name.length > 2 &&\n name.charCodeAt(0) === 111 &&\n name.charCodeAt(1) === 110 &&\n name.charCodeAt(2) >= 65 &&\n name.charCodeAt(2) <= 90\n );\n}\n\nexport function splitEventProps(props) {\n if (!props) return { cleanProps: props, events: null };\n var events = null;\n var cleanProps = null;\n for (var k in props) {\n if (_isEventProp(k) && typeof props[k] === 'function') {\n if (!events) {\n events = {};\n cleanProps = {};\n for (var j in props) {\n if (j === k) break;\n cleanProps[j] = props[j];\n }\n }\n events[k] = props[k];\n } else if (events) {\n cleanProps[k] = props[k];\n }\n }\n return { cleanProps: cleanProps || props, events: events };\n}\n\nexport function makeEventRef(events, userRef) {\n return function(el) {\n if (el) {\n for (var name in events) {\n var domName = _reactToDomEvent[name.toLowerCase()] || name.toLowerCase();\n el[domName] = events[name];\n }\n }\n if (typeof userRef === 'function') userRef(el);\n else if (userRef != null && typeof userRef === 'object') userRef.current = el;\n };\n}", l = "import {\n jsx as _originalJsx,\n jsxs as _originalJsxs,\n Fragment,\n} from '__real_react_jsx_runtime__';\n\nimport {\n customElementMap,\n injectStyleViaHead,\n extractCssText,\n splitEventProps,\n makeEventRef,\n} from '__jsx_shared_helpers__';\n\nfunction _wrapJsxFactory(originalFactory) {\n return function wrappedJsx(type, props, key) {\n if (typeof type === 'string') {\n if (type === 'style') {\n var css =\n props && props.dangerouslySetInnerHTML\n ? props.dangerouslySetInnerHTML.__html || ''\n : extractCssText(props && props.children);\n injectStyleViaHead(css);\n return null;\n }\n\n var customTag = customElementMap[type];\n if (customTag) {\n var split = splitEventProps(props);\n if (split.events) {\n var cp = split.cleanProps;\n cp.ref = makeEventRef(split.events, cp.ref);\n return originalFactory(customTag, cp, key);\n }\n return originalFactory(customTag, props, key);\n }\n }\n return originalFactory(type, props, key);\n };\n}\n\nexport var jsx = _wrapJsxFactory(_originalJsx);\nexport var jsxs = _wrapJsxFactory(_originalJsxs);\nexport { Fragment };", u = "export * from '__real_react__';\nimport _React from '__real_react__';\n\nimport {\n customElementMap,\n injectStyleViaHead,\n extractCssText,\n splitEventProps,\n makeEventRef,\n} from '__jsx_shared_helpers__';\n\nvar _originalCreateElement = _React.createElement;\n\nfunction createElement(type) {\n var args = arguments;\n if (typeof type === 'string') {\n if (type === 'style') {\n var props = args.length > 1 ? args[1] : null;\n if (props) {\n var css = props.dangerouslySetInnerHTML\n ? props.dangerouslySetInnerHTML.__html || ''\n : extractCssText(props.children);\n injectStyleViaHead(css);\n }\n return null;\n }\n\n var customTag = customElementMap[type];\n if (customTag) {\n var ceProps = args.length > 1 ? args[1] : null;\n var split = splitEventProps(ceProps);\n if (split.events) {\n var cp = split.cleanProps || {};\n cp.ref = makeEventRef(split.events, cp.ref);\n var newArgs = [customTag, cp];\n for (var i = 2; i < args.length; i++) newArgs.push(args[i]);\n return _originalCreateElement.apply(null, newArgs);\n }\n var newArgs2 = [customTag];\n for (var i2 = 1; i2 < args.length; i2++) newArgs2.push(args[i2]);\n return _originalCreateElement.apply(null, newArgs2);\n }\n }\n return _originalCreateElement.apply(null, args);\n}\n\nexport { createElement };\nexport default Object.assign({}, _React, { createElement: createElement });", d = (e) => {
|
|
21
|
-
let t = e?.usePreact ?? !1, n = t ? "preact/jsx-runtime" : "react/jsx-runtime", r = t ? "preact/compat" : "react";
|
|
22
|
-
return {
|
|
23
|
-
name: "jsx-runtime-remote-wrapper",
|
|
24
|
-
setup: (e) => {
|
|
25
|
-
let t, i;
|
|
26
|
-
e.onResolve({ filter: /^__jsx_shared_helpers__$/ }, () => ({
|
|
27
|
-
path: "__jsx_shared_helpers__",
|
|
28
|
-
namespace: "jsx-shared-helpers"
|
|
29
|
-
})), e.onLoad({
|
|
30
|
-
filter: /.*/,
|
|
31
|
-
namespace: "jsx-shared-helpers"
|
|
32
|
-
}, () => ({
|
|
33
|
-
contents: c,
|
|
34
|
-
loader: "js"
|
|
35
|
-
})), e.onResolve({ filter: /^react\/jsx-runtime$/ }, async (r) => {
|
|
36
|
-
if (!r.pluginData?.skipJsxWrapper) return t ||= (await e.resolve(n, {
|
|
37
|
-
kind: r.kind,
|
|
38
|
-
resolveDir: r.resolveDir,
|
|
39
|
-
pluginData: { skipJsxWrapper: !0 }
|
|
40
|
-
})).path, {
|
|
41
|
-
path: "react/jsx-runtime",
|
|
42
|
-
namespace: "jsx-runtime-wrapper"
|
|
43
|
-
};
|
|
44
|
-
}), e.onResolve({ filter: /^__real_react_jsx_runtime__$/ }, () => {
|
|
45
|
-
if (!t) throw Error("jsx-runtime-remote-wrapper: real jsx-runtime path not resolved yet");
|
|
46
|
-
return { path: t };
|
|
47
|
-
}), e.onLoad({
|
|
48
|
-
filter: /.*/,
|
|
49
|
-
namespace: "jsx-runtime-wrapper"
|
|
50
|
-
}, () => ({
|
|
51
|
-
contents: l,
|
|
52
|
-
loader: "js"
|
|
53
|
-
})), e.onResolve({ filter: /^react$/ }, async (t) => {
|
|
54
|
-
if (!t.pluginData?.skipJsxWrapper) return i ||= (await e.resolve(r, {
|
|
55
|
-
kind: t.kind,
|
|
56
|
-
resolveDir: t.resolveDir,
|
|
57
|
-
pluginData: { skipJsxWrapper: !0 }
|
|
58
|
-
})).path, {
|
|
59
|
-
path: "react",
|
|
60
|
-
namespace: "react-wrapper"
|
|
61
|
-
};
|
|
62
|
-
}), e.onResolve({ filter: /^__real_react__$/ }, () => {
|
|
63
|
-
if (!i) throw Error("jsx-runtime-remote-wrapper: real react path not resolved yet");
|
|
64
|
-
return { path: i };
|
|
65
|
-
}), e.onLoad({
|
|
66
|
-
filter: /.*/,
|
|
67
|
-
namespace: "react-wrapper"
|
|
68
|
-
}, () => ({
|
|
69
|
-
contents: u,
|
|
70
|
-
loader: "js"
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
}, f = /import\s*\{\s*define(?:Settings)?FrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g, p = /export\s+default\s+define(?:Settings)?FrontComponent\s*\(/, m = /component\s*:\s*([A-Za-z_$][\w$]*)\s*[,}]/, h = "__frontComponentDefinition", g = (e) => {
|
|
75
|
-
let t = e.replace(f, "");
|
|
76
|
-
if (!p.test(t)) return t;
|
|
77
|
-
t = t.replace(p, `const ${h} = (`);
|
|
78
|
-
let n = t.match(m);
|
|
79
|
-
if (n) {
|
|
80
|
-
let e = n[1];
|
|
81
|
-
t = t.replace(RegExp(`export\\s+(const|function)\\s+${e}\\b`), `$1 ${e}`);
|
|
82
|
-
}
|
|
83
|
-
return "import { createRoot as __createRoot } from 'react-dom/client';\nimport { jsx as __frontComponentJsx } from 'react/jsx-runtime';\n" + t + `\nexport default function __renderFrontComponent(__container) { __createRoot(__container).render(__frontComponentJsx(${h}.component, {})); }\n`;
|
|
84
|
-
}, _ = {
|
|
85
|
-
name: "jsx-transform-to-remote-dom-worker-format-plugin",
|
|
86
|
-
setup: (e) => {
|
|
87
|
-
e.onLoad({ filter: /\.tsx$/ }, async ({ path: e }) => {
|
|
88
|
-
try {
|
|
89
|
-
return {
|
|
90
|
-
contents: g(await i(e, "utf8")),
|
|
91
|
-
loader: "tsx"
|
|
92
|
-
};
|
|
93
|
-
} catch (t) {
|
|
94
|
-
return { errors: [{
|
|
95
|
-
text: `Failed to transform front component: ${t instanceof Error ? t.message : String(t)}`,
|
|
96
|
-
location: { file: e }
|
|
97
|
-
}] };
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}, v = () => ({
|
|
102
|
-
name: "preact-alias",
|
|
103
|
-
setup: (e) => {
|
|
104
|
-
let t;
|
|
105
|
-
e.onResolve({ filter: /^react-dom\/client$/ }, async (n) => (t ||= (await e.resolve("preact/compat/client", {
|
|
106
|
-
kind: n.kind,
|
|
107
|
-
resolveDir: n.resolveDir
|
|
108
|
-
})).path, { path: t })), e.onResolve({ filter: /^react-dom$/ }, async (t) => ({ path: (await e.resolve("preact/compat", {
|
|
109
|
-
kind: t.kind,
|
|
110
|
-
resolveDir: t.resolveDir
|
|
111
|
-
})).path }));
|
|
112
|
-
}
|
|
113
|
-
}), y = /^\/\/.*$\n/gm, b = {
|
|
114
|
-
name: "strip-comments",
|
|
115
|
-
setup: (e) => {
|
|
116
|
-
e.onEnd(async (e) => {
|
|
117
|
-
if (e.errors.length > 0) return;
|
|
118
|
-
let t = Object.keys(e.metafile?.outputs ?? {}).filter((e) => e.endsWith(".mjs"));
|
|
119
|
-
for (let e of t) {
|
|
120
|
-
let t = r.resolve(e), n = await i(t, "utf-8"), o = n.replace(y, "");
|
|
121
|
-
o !== n && await a(t, o, "utf-8");
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}, x = (e) => [
|
|
126
|
-
d(e?.usePreact ? { usePreact: !0 } : void 0),
|
|
127
|
-
...e?.usePreact ? [v()] : [],
|
|
128
|
-
_,
|
|
129
|
-
s,
|
|
130
|
-
b
|
|
131
|
-
];
|
|
132
|
-
//#endregion
|
|
133
|
-
export { x as t };
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let u=require("path");u=l(u);let d=require("node:fs/promises");var f=e=>`if (typeof document !== 'undefined') {
|
|
2
|
-
const styleElement = document.createElement('style');
|
|
3
|
-
document.head.appendChild(styleElement);
|
|
4
|
-
styleElement.textContent = ${JSON.stringify(e)};
|
|
5
|
-
}`,p={name:`css-injection`,setup:e=>{e.onLoad({filter:/\.css$/},async({path:e})=>({contents:f(await(0,d.readFile)(e,`utf8`)),loader:`js`}))}},m=`export var customElementMap = globalThis.__HTML_TAG_TO_CUSTOM_ELEMENT_TAG__ || {};
|
|
6
|
-
|
|
7
|
-
var _injectedStyleKeys = {};
|
|
8
|
-
|
|
9
|
-
export function injectStyleViaHead(cssText) {
|
|
10
|
-
if (!cssText) return;
|
|
11
|
-
var hash = 0;
|
|
12
|
-
for (var i = 0; i < cssText.length; i++) {
|
|
13
|
-
hash = ((hash << 5) - hash + cssText.charCodeAt(i)) | 0;
|
|
14
|
-
}
|
|
15
|
-
var key = 'jsx-style-' + hash;
|
|
16
|
-
if (_injectedStyleKeys[key]) return;
|
|
17
|
-
_injectedStyleKeys[key] = true;
|
|
18
|
-
var el = document.createElement('style');
|
|
19
|
-
el.setAttribute('data-jsx-style', key);
|
|
20
|
-
el.textContent = cssText;
|
|
21
|
-
document.head.appendChild(el);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function extractCssText(children) {
|
|
25
|
-
if (typeof children === 'string') return children;
|
|
26
|
-
if (Array.isArray(children))
|
|
27
|
-
return children
|
|
28
|
-
.filter(function (c) { return typeof c === 'string'; })
|
|
29
|
-
.join('');
|
|
30
|
-
return '';
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
var _reactToDomEvent = {
|
|
34
|
-
ondoubleclick: 'ondblclick',
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function _isEventProp(name) {
|
|
38
|
-
return (
|
|
39
|
-
name.length > 2 &&
|
|
40
|
-
name.charCodeAt(0) === 111 &&
|
|
41
|
-
name.charCodeAt(1) === 110 &&
|
|
42
|
-
name.charCodeAt(2) >= 65 &&
|
|
43
|
-
name.charCodeAt(2) <= 90
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function splitEventProps(props) {
|
|
48
|
-
if (!props) return { cleanProps: props, events: null };
|
|
49
|
-
var events = null;
|
|
50
|
-
var cleanProps = null;
|
|
51
|
-
for (var k in props) {
|
|
52
|
-
if (_isEventProp(k) && typeof props[k] === 'function') {
|
|
53
|
-
if (!events) {
|
|
54
|
-
events = {};
|
|
55
|
-
cleanProps = {};
|
|
56
|
-
for (var j in props) {
|
|
57
|
-
if (j === k) break;
|
|
58
|
-
cleanProps[j] = props[j];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
events[k] = props[k];
|
|
62
|
-
} else if (events) {
|
|
63
|
-
cleanProps[k] = props[k];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return { cleanProps: cleanProps || props, events: events };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function makeEventRef(events, userRef) {
|
|
70
|
-
return function(el) {
|
|
71
|
-
if (el) {
|
|
72
|
-
for (var name in events) {
|
|
73
|
-
var domName = _reactToDomEvent[name.toLowerCase()] || name.toLowerCase();
|
|
74
|
-
el[domName] = events[name];
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
if (typeof userRef === 'function') userRef(el);
|
|
78
|
-
else if (userRef != null && typeof userRef === 'object') userRef.current = el;
|
|
79
|
-
};
|
|
80
|
-
}`,h=`import {
|
|
81
|
-
jsx as _originalJsx,
|
|
82
|
-
jsxs as _originalJsxs,
|
|
83
|
-
Fragment,
|
|
84
|
-
} from '__real_react_jsx_runtime__';
|
|
85
|
-
|
|
86
|
-
import {
|
|
87
|
-
customElementMap,
|
|
88
|
-
injectStyleViaHead,
|
|
89
|
-
extractCssText,
|
|
90
|
-
splitEventProps,
|
|
91
|
-
makeEventRef,
|
|
92
|
-
} from '__jsx_shared_helpers__';
|
|
93
|
-
|
|
94
|
-
function _wrapJsxFactory(originalFactory) {
|
|
95
|
-
return function wrappedJsx(type, props, key) {
|
|
96
|
-
if (typeof type === 'string') {
|
|
97
|
-
if (type === 'style') {
|
|
98
|
-
var css =
|
|
99
|
-
props && props.dangerouslySetInnerHTML
|
|
100
|
-
? props.dangerouslySetInnerHTML.__html || ''
|
|
101
|
-
: extractCssText(props && props.children);
|
|
102
|
-
injectStyleViaHead(css);
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
var customTag = customElementMap[type];
|
|
107
|
-
if (customTag) {
|
|
108
|
-
var split = splitEventProps(props);
|
|
109
|
-
if (split.events) {
|
|
110
|
-
var cp = split.cleanProps;
|
|
111
|
-
cp.ref = makeEventRef(split.events, cp.ref);
|
|
112
|
-
return originalFactory(customTag, cp, key);
|
|
113
|
-
}
|
|
114
|
-
return originalFactory(customTag, props, key);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return originalFactory(type, props, key);
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export var jsx = _wrapJsxFactory(_originalJsx);
|
|
122
|
-
export var jsxs = _wrapJsxFactory(_originalJsxs);
|
|
123
|
-
export { Fragment };`,g=`export * from '__real_react__';
|
|
124
|
-
import _React from '__real_react__';
|
|
125
|
-
|
|
126
|
-
import {
|
|
127
|
-
customElementMap,
|
|
128
|
-
injectStyleViaHead,
|
|
129
|
-
extractCssText,
|
|
130
|
-
splitEventProps,
|
|
131
|
-
makeEventRef,
|
|
132
|
-
} from '__jsx_shared_helpers__';
|
|
133
|
-
|
|
134
|
-
var _originalCreateElement = _React.createElement;
|
|
135
|
-
|
|
136
|
-
function createElement(type) {
|
|
137
|
-
var args = arguments;
|
|
138
|
-
if (typeof type === 'string') {
|
|
139
|
-
if (type === 'style') {
|
|
140
|
-
var props = args.length > 1 ? args[1] : null;
|
|
141
|
-
if (props) {
|
|
142
|
-
var css = props.dangerouslySetInnerHTML
|
|
143
|
-
? props.dangerouslySetInnerHTML.__html || ''
|
|
144
|
-
: extractCssText(props.children);
|
|
145
|
-
injectStyleViaHead(css);
|
|
146
|
-
}
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
var customTag = customElementMap[type];
|
|
151
|
-
if (customTag) {
|
|
152
|
-
var ceProps = args.length > 1 ? args[1] : null;
|
|
153
|
-
var split = splitEventProps(ceProps);
|
|
154
|
-
if (split.events) {
|
|
155
|
-
var cp = split.cleanProps || {};
|
|
156
|
-
cp.ref = makeEventRef(split.events, cp.ref);
|
|
157
|
-
var newArgs = [customTag, cp];
|
|
158
|
-
for (var i = 2; i < args.length; i++) newArgs.push(args[i]);
|
|
159
|
-
return _originalCreateElement.apply(null, newArgs);
|
|
160
|
-
}
|
|
161
|
-
var newArgs2 = [customTag];
|
|
162
|
-
for (var i2 = 1; i2 < args.length; i2++) newArgs2.push(args[i2]);
|
|
163
|
-
return _originalCreateElement.apply(null, newArgs2);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return _originalCreateElement.apply(null, args);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export { createElement };
|
|
170
|
-
export default Object.assign({}, _React, { createElement: createElement });`,_=e=>{let t=e?.usePreact??!1,n=t?`preact/jsx-runtime`:`react/jsx-runtime`,r=t?`preact/compat`:`react`;return{name:`jsx-runtime-remote-wrapper`,setup:e=>{let t,i;e.onResolve({filter:/^__jsx_shared_helpers__$/},()=>({path:`__jsx_shared_helpers__`,namespace:`jsx-shared-helpers`})),e.onLoad({filter:/.*/,namespace:`jsx-shared-helpers`},()=>({contents:m,loader:`js`})),e.onResolve({filter:/^react\/jsx-runtime$/},async r=>{if(!r.pluginData?.skipJsxWrapper)return t||=(await e.resolve(n,{kind:r.kind,resolveDir:r.resolveDir,pluginData:{skipJsxWrapper:!0}})).path,{path:`react/jsx-runtime`,namespace:`jsx-runtime-wrapper`}}),e.onResolve({filter:/^__real_react_jsx_runtime__$/},()=>{if(!t)throw Error(`jsx-runtime-remote-wrapper: real jsx-runtime path not resolved yet`);return{path:t}}),e.onLoad({filter:/.*/,namespace:`jsx-runtime-wrapper`},()=>({contents:h,loader:`js`})),e.onResolve({filter:/^react$/},async t=>{if(!t.pluginData?.skipJsxWrapper)return i||=(await e.resolve(r,{kind:t.kind,resolveDir:t.resolveDir,pluginData:{skipJsxWrapper:!0}})).path,{path:`react`,namespace:`react-wrapper`}}),e.onResolve({filter:/^__real_react__$/},()=>{if(!i)throw Error(`jsx-runtime-remote-wrapper: real react path not resolved yet`);return{path:i}}),e.onLoad({filter:/.*/,namespace:`react-wrapper`},()=>({contents:g,loader:`js`}))}}},v=/import\s*\{\s*define(?:Settings)?FrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,y=/export\s+default\s+define(?:Settings)?FrontComponent\s*\(/,b=/component\s*:\s*([A-Za-z_$][\w$]*)\s*[,}]/,x=`__frontComponentDefinition`,S=e=>{let t=e.replace(v,``);if(!y.test(t))return t;t=t.replace(y,`const ${x} = (`);let n=t.match(b);if(n){let e=n[1];t=t.replace(RegExp(`export\\s+(const|function)\\s+${e}\\b`),`$1 ${e}`)}return`import { createRoot as __createRoot } from 'react-dom/client';
|
|
171
|
-
import { jsx as __frontComponentJsx } from 'react/jsx-runtime';
|
|
172
|
-
`+t+`\nexport default function __renderFrontComponent(__container) { __createRoot(__container).render(__frontComponentJsx(${x}.component, {})); }\n`},C={name:`jsx-transform-to-remote-dom-worker-format-plugin`,setup:e=>{e.onLoad({filter:/\.tsx$/},async({path:e})=>{try{return{contents:S(await(0,d.readFile)(e,`utf8`)),loader:`tsx`}}catch(t){return{errors:[{text:`Failed to transform front component: ${t instanceof Error?t.message:String(t)}`,location:{file:e}}]}}})}},w=()=>({name:`preact-alias`,setup:e=>{let t;e.onResolve({filter:/^react-dom\/client$/},async n=>(t||=(await e.resolve(`preact/compat/client`,{kind:n.kind,resolveDir:n.resolveDir})).path,{path:t})),e.onResolve({filter:/^react-dom$/},async t=>({path:(await e.resolve(`preact/compat`,{kind:t.kind,resolveDir:t.resolveDir})).path}))}}),T=/^\/\/.*$\n/gm,E={name:`strip-comments`,setup:e=>{e.onEnd(async e=>{if(e.errors.length>0)return;let t=Object.keys(e.metafile?.outputs??{}).filter(e=>e.endsWith(`.mjs`));for(let e of t){let t=u.default.resolve(e),n=await(0,d.readFile)(t,`utf-8`),r=n.replace(T,``);r!==n&&await(0,d.writeFile)(t,r,`utf-8`)}})}},D=e=>[_(e?.usePreact?{usePreact:!0}:void 0),...e?.usePreact?[w()]:[],C,p,E];Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return D}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./isDefined-Dtu5EYqP-Dp026Ry1.js");let t=require("typescript");var n=`TwentyRecord`,r=n=>{let r=n.typeArguments?.[0];if(e.t(r)&&r.kind===t.SyntaxKind.LiteralType&&r.literal.kind===t.SyntaxKind.StringLiteral)return r.literal.text},i=e=>e.type===`record`?{type:`records`,objectUniversalIdentifier:e.objectUniversalIdentifier}:{type:`array`,items:e},a=o=>{switch(o.kind){case t.SyntaxKind.NumberKeyword:return{type:`number`};case t.SyntaxKind.StringKeyword:return{type:`string`};case t.SyntaxKind.BooleanKeyword:return{type:`boolean`};case t.SyntaxKind.ArrayType:return i(a(o.elementType));case t.SyntaxKind.TypeReference:{let s=o,c=s.typeName.kind===t.SyntaxKind.Identifier?s.typeName.text:void 0;if(c===`Array`||c===`ReadonlyArray`){let t=s.typeArguments?.[0];return i(e.t(t)?a(t):{})}if(c===n){let t=r(s);if(e.t(t))return{type:`record`,objectUniversalIdentifier:t}}return{}}case t.SyntaxKind.ObjectKeyword:return{type:`object`};case t.SyntaxKind.TypeLiteral:{let t={};return o.members.forEach(n=>{if(e.t(n.name)&&e.t(n.type)){let e=n.name.text;t[e]=a(n.type)}}),{type:`object`,properties:t}}case t.SyntaxKind.UnionType:{let e=o,n=[],r=!0;return e.types.forEach(e=>{if(e.kind===t.SyntaxKind.LiteralType){let i=e.literal;i.kind===t.SyntaxKind.StringLiteral?n.push(i.text):r=!1}else r=!1}),r?{type:`string`,enum:n}:{}}default:return{}}},o=(t,n)=>t.parameters.reduce((t,n)=>{let r=n.type;return e.t(r)?[...t,a(r)]:[...t,{}]},n),s=n=>n.kind===t.SyntaxKind.FunctionDeclaration?[n]:n.kind===t.SyntaxKind.VariableStatement?n.declarationList.declarations.filter(n=>e.t(n.initializer)&&n.initializer.kind===t.SyntaxKind.ArrowFunction).map(e=>e.initializer):[],c=e=>{let n=(0,t.createSourceFile)(`temp.ts`,e,t.ScriptTarget.ESNext,!0),r=[];return n.forEachChild(e=>{(e.kind===t.SyntaxKind.FunctionDeclaration||e.kind===t.SyntaxKind.VariableStatement)&&s(e).forEach(e=>{r=o(e,r)})}),r};exports.getFunctionInputSchema=c;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("@sniptt/guards");var t=t=>!(0,e.isUndefined)(t)&&!(0,e.isNull)(t);Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|