twenty-sdk 2.16.0 → 2.18.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/{catalog-sync-w6yKppKP.js → catalog-sync-CgKswjsE.js} +1 -1
- package/dist/{catalog-sync-BYM3GqZl.mjs → catalog-sync-YxvEEHz5.mjs} +1 -1
- package/dist/cli/commands/dev/i18n-extract.d.ts +7 -0
- package/dist/cli/utilities/build/common/front-component-build/css-injection-plugin.d.ts +2 -0
- package/dist/cli/utilities/i18n/collect-translatable-strings.d.ts +2 -0
- package/dist/cli/utilities/i18n/compile-application-translations.d.ts +1 -0
- package/dist/cli/utilities/i18n/constants.d.ts +1 -0
- package/dist/cli/utilities/i18n/extract-application-translations.d.ts +10 -0
- package/dist/cli/utilities/i18n/generate-message-id.d.ts +1 -0
- package/dist/cli.cjs +17 -15
- package/dist/cli.mjs +995 -935
- package/dist/define/index.cjs +2 -2
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +14 -5
- package/dist/define/index.mjs +28 -71
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +1 -1
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.d.ts +42 -12
- package/dist/front-component/index.mjs +134 -143
- 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-DBupR4cF.js → get-front-component-build-plugins-Dqpyup2W.js} +9 -5
- package/dist/get-front-component-build-plugins-taotEFOp.mjs +126 -0
- package/dist/{get-function-input-schema-GNk3NRLJ-zQkANyT3.mjs → get-function-input-schema-GNk3NRLJ-CfeAvjEl.mjs} +1 -1
- package/dist/{login-D7nyXinY.js → login-BOrzi4Z0.js} +50 -50
- package/dist/{login-rU5te3B6.mjs → login-Dg4Ap-uo.mjs} +3983 -3993
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +1 -1
- package/package.json +3 -12
- package/dist/AllIcons-CdbaxNyc-CJcUHQBl.mjs +0 -66238
- package/dist/AllIcons-CdbaxNyc-DR-8e_UM.js +0 -1
- package/dist/get-front-component-build-plugins-BuE2QdIr.mjs +0 -113
- package/dist/icon-DMT-YeKi-C9-AduNa.mjs +0 -10168
- package/dist/icon-DMT-YeKi-Cz0W5sJA.js +0 -1
- package/dist/ui/index.cjs +0 -26
- package/dist/ui/index.d.ts +0 -18
- package/dist/ui/index.mjs +0 -15562
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import e from "path";
|
|
2
|
-
import { readFile as t, writeFile as n } from "node:fs/promises";
|
|
3
|
-
//#region src/cli/utilities/build/common/front-component-build/jsx-runtime-remote-wrapper-plugin.ts
|
|
4
|
-
var r = "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}", i = "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 };", a = "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 });", o = (e) => {
|
|
5
|
-
let t = e?.usePreact ?? !1, n = t ? "preact/jsx-runtime" : "react/jsx-runtime", o = t ? "preact/compat" : "react";
|
|
6
|
-
return {
|
|
7
|
-
name: "jsx-runtime-remote-wrapper",
|
|
8
|
-
setup: (e) => {
|
|
9
|
-
let t, s;
|
|
10
|
-
e.onResolve({ filter: /^__jsx_shared_helpers__$/ }, () => ({
|
|
11
|
-
path: "__jsx_shared_helpers__",
|
|
12
|
-
namespace: "jsx-shared-helpers"
|
|
13
|
-
})), e.onLoad({
|
|
14
|
-
filter: /.*/,
|
|
15
|
-
namespace: "jsx-shared-helpers"
|
|
16
|
-
}, () => ({
|
|
17
|
-
contents: r,
|
|
18
|
-
loader: "js"
|
|
19
|
-
})), e.onResolve({ filter: /^react\/jsx-runtime$/ }, async (r) => {
|
|
20
|
-
if (!r.pluginData?.skipJsxWrapper) return t ||= (await e.resolve(n, {
|
|
21
|
-
kind: r.kind,
|
|
22
|
-
resolveDir: r.resolveDir,
|
|
23
|
-
pluginData: { skipJsxWrapper: !0 }
|
|
24
|
-
})).path, {
|
|
25
|
-
path: "react/jsx-runtime",
|
|
26
|
-
namespace: "jsx-runtime-wrapper"
|
|
27
|
-
};
|
|
28
|
-
}), e.onResolve({ filter: /^__real_react_jsx_runtime__$/ }, () => {
|
|
29
|
-
if (!t) throw Error("jsx-runtime-remote-wrapper: real jsx-runtime path not resolved yet");
|
|
30
|
-
return { path: t };
|
|
31
|
-
}), e.onLoad({
|
|
32
|
-
filter: /.*/,
|
|
33
|
-
namespace: "jsx-runtime-wrapper"
|
|
34
|
-
}, () => ({
|
|
35
|
-
contents: i,
|
|
36
|
-
loader: "js"
|
|
37
|
-
})), e.onResolve({ filter: /^react$/ }, async (t) => {
|
|
38
|
-
if (!t.pluginData?.skipJsxWrapper) return s ||= (await e.resolve(o, {
|
|
39
|
-
kind: t.kind,
|
|
40
|
-
resolveDir: t.resolveDir,
|
|
41
|
-
pluginData: { skipJsxWrapper: !0 }
|
|
42
|
-
})).path, {
|
|
43
|
-
path: "react",
|
|
44
|
-
namespace: "react-wrapper"
|
|
45
|
-
};
|
|
46
|
-
}), e.onResolve({ filter: /^__real_react__$/ }, () => {
|
|
47
|
-
if (!s) throw Error("jsx-runtime-remote-wrapper: real react path not resolved yet");
|
|
48
|
-
return { path: s };
|
|
49
|
-
}), e.onLoad({
|
|
50
|
-
filter: /.*/,
|
|
51
|
-
namespace: "react-wrapper"
|
|
52
|
-
}, () => ({
|
|
53
|
-
contents: a,
|
|
54
|
-
loader: "js"
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}, s = /import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g, c = /export\s+default\s+defineFrontComponent\s*\(\s*\{[\s\S]*?component\s*:\s*(\w+)[\s\S]*?\}\s*\)\s*;?/s, l = (e) => {
|
|
59
|
-
let t = e.replace(s, ""), n = t.match(c);
|
|
60
|
-
if (n) {
|
|
61
|
-
let e = n[1], r = RegExp(`export\\s+(const|function)\\s+${e}\\b`);
|
|
62
|
-
t = t.replace(r, `$1 ${e}`), t = "import { createRoot as __createRoot } from 'react-dom/client';\nimport { jsx as __frontComponentJsx } from 'react/jsx-runtime';\n" + t, t = t.replace(c, `export default function __renderFrontComponent(__container) { __createRoot(__container).render(__frontComponentJsx(${e}, {})); }`);
|
|
63
|
-
}
|
|
64
|
-
return t;
|
|
65
|
-
}, u = {
|
|
66
|
-
name: "jsx-transform-to-remote-dom-worker-format-plugin",
|
|
67
|
-
setup: (e) => {
|
|
68
|
-
e.onLoad({ filter: /\.tsx$/ }, async ({ path: e }) => {
|
|
69
|
-
try {
|
|
70
|
-
return {
|
|
71
|
-
contents: l(await t(e, "utf8")),
|
|
72
|
-
loader: "tsx"
|
|
73
|
-
};
|
|
74
|
-
} catch (t) {
|
|
75
|
-
return { errors: [{
|
|
76
|
-
text: `Failed to transform front component: ${t instanceof Error ? t.message : String(t)}`,
|
|
77
|
-
location: { file: e }
|
|
78
|
-
}] };
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}, d = () => ({
|
|
83
|
-
name: "preact-alias",
|
|
84
|
-
setup: (e) => {
|
|
85
|
-
let t;
|
|
86
|
-
e.onResolve({ filter: /^react-dom\/client$/ }, async (n) => (t ||= (await e.resolve("preact/compat/client", {
|
|
87
|
-
kind: n.kind,
|
|
88
|
-
resolveDir: n.resolveDir
|
|
89
|
-
})).path, { path: t })), e.onResolve({ filter: /^react-dom$/ }, async (t) => ({ path: (await e.resolve("preact/compat", {
|
|
90
|
-
kind: t.kind,
|
|
91
|
-
resolveDir: t.resolveDir
|
|
92
|
-
})).path }));
|
|
93
|
-
}
|
|
94
|
-
}), f = /^\/\/.*$\n/gm, p = {
|
|
95
|
-
name: "strip-comments",
|
|
96
|
-
setup: (r) => {
|
|
97
|
-
r.onEnd(async (r) => {
|
|
98
|
-
if (r.errors.length > 0) return;
|
|
99
|
-
let i = Object.keys(r.metafile?.outputs ?? {}).filter((e) => e.endsWith(".mjs"));
|
|
100
|
-
for (let r of i) {
|
|
101
|
-
let i = e.resolve(r), a = await t(i, "utf-8"), o = a.replace(f, "");
|
|
102
|
-
o !== a && await n(i, o, "utf-8");
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}, m = (e) => [
|
|
107
|
-
o(e?.usePreact ? { usePreact: !0 } : void 0),
|
|
108
|
-
...e?.usePreact ? [d()] : [],
|
|
109
|
-
u,
|
|
110
|
-
p
|
|
111
|
-
];
|
|
112
|
-
//#endregion
|
|
113
|
-
export { m as t };
|