@declarion/react 0.1.78 → 0.1.80
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-lib/DraggableChildrenTable-CcXR8Vm6.js +281 -0
- package/dist-lib/DraggableChildrenTable-CcXR8Vm6.js.map +1 -0
- package/dist-lib/Grid-CseTLMLv.js +405 -0
- package/dist-lib/Grid-CseTLMLv.js.map +1 -0
- package/dist-lib/{JsonEditor-CWueGEgA.js → JsonEditor-Tew1oNqZ.js} +1 -1
- package/dist-lib/{JsonEditor-CWueGEgA.js.map → JsonEditor-Tew1oNqZ.js.map} +1 -1
- package/dist-lib/MarkdownRenderer-Dl3GDuY9.js +72 -0
- package/dist-lib/MarkdownRenderer-Dl3GDuY9.js.map +1 -0
- package/dist-lib/components/detail-layout/index.d.ts +0 -1
- package/dist-lib/components/fields/cells/factories/markdownToPlainText.d.ts +7 -14
- package/dist-lib/components/file-widgets/GridLazy.d.ts +2 -0
- package/dist-lib/components/file-widgets/index.d.ts +1 -1
- package/dist-lib/components/shared/Markdown.d.ts +3 -0
- package/dist-lib/components/shared/MarkdownRenderer.d.ts +11 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/hooks/useAllEntityData.d.ts +16 -0
- package/dist-lib/index.d.ts +1 -0
- package/dist-lib/index.js +7567 -14504
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/lib/actions.d.ts +35 -0
- package/dist-lib/lib/capabilityPrefetch.d.ts +6 -0
- package/dist-lib/rich-text-CaQ6-8Gx.js +48 -0
- package/dist-lib/rich-text-CaQ6-8Gx.js.map +1 -0
- package/dist-lib/stores/tabs.d.ts +1 -0
- package/dist-lib/types/fieldType.d.ts +1 -1
- package/dist-lib/useUserLocale-D9wc5kzQ.js +5723 -0
- package/dist-lib/useUserLocale-D9wc5kzQ.js.map +1 -0
- package/dist-lib/value-FIp50R1-.js +571 -0
- package/dist-lib/value-FIp50R1-.js.map +1 -0
- package/package.json +3 -2
|
@@ -140,4 +140,39 @@ export declare function filterLayoutForSlot(layout: ResolvedActionLayoutNode[],
|
|
|
140
140
|
bulkRequiredPredicate?: (action: Action) => boolean;
|
|
141
141
|
excludeIf?: (action: Action) => boolean;
|
|
142
142
|
}): ResolvedActionLayoutNode[];
|
|
143
|
+
/**
|
|
144
|
+
* True when an action should be treated as requiring a row selection.
|
|
145
|
+
*
|
|
146
|
+
* THIS IS A PROXY, not the canonical rule. The canonical "requires
|
|
147
|
+
* selection" answer is derived per dispatch mode (see docs/dsl.md §16.6.2:
|
|
148
|
+
* `handler.invoke`, association semantics, `href ${id}`). The SDK cannot
|
|
149
|
+
* evaluate that rule - the resolved-action wire format carries no `invoke`
|
|
150
|
+
* value, and two of the five modes (`ui_steps`, `widget`) have no
|
|
151
|
+
* derivation at all. So the SDK stands in slot membership: an action is
|
|
152
|
+
* selection-mode iff its `visibility` includes `list_floatbar`.
|
|
153
|
+
*
|
|
154
|
+
* This matches the platform's authoring guidance - the loader's
|
|
155
|
+
* `bulk_selection_required`-removal error tells authors to "use
|
|
156
|
+
* visibility: [list_floatbar] for selection-mode actions" - so the proxy
|
|
157
|
+
* agrees with the canonical rule for every guideline-following schema
|
|
158
|
+
* (a mis-declared schema can diverge). Full rationale, the divergence
|
|
159
|
+
* case, and the planned hybrid replacement: docs/architecture.md
|
|
160
|
+
* "List Toolbar Selection Model".
|
|
161
|
+
*
|
|
162
|
+
* Drives list-toolbar state: a selection-mode action renders disabled
|
|
163
|
+
* while no rows are selected, and moves to the floatbar (not the static
|
|
164
|
+
* toolbar) once a selection exists.
|
|
165
|
+
*/
|
|
166
|
+
export declare function actionRequiresSelection(action: Action): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Walks a ResolvedActionLayoutNode[] and sets `enabled: false` plus the
|
|
169
|
+
* given `reason` on every leaf whose action satisfies `predicate`. Groups
|
|
170
|
+
* are recursed into; tree structure is preserved (no nodes dropped) so the
|
|
171
|
+
* user still sees what is available. Leaves whose code cannot be resolved
|
|
172
|
+
* are left untouched (defensive; the server should have pruned them).
|
|
173
|
+
*
|
|
174
|
+
* Use: grey out selection-mode actions on the list toolbar while no rows
|
|
175
|
+
* are selected.
|
|
176
|
+
*/
|
|
177
|
+
export declare function disableLeavesWhere(layout: ResolvedActionLayoutNode[], entityActions: Record<string, Action> | undefined, globalActions: Record<string, Action> | undefined, predicate: (action: Action) => boolean, reason: string): ResolvedActionLayoutNode[];
|
|
143
178
|
export declare function defaultFlatForSlot(actions: Record<string, Action> | undefined, slot: string): ResolvedActionLayoutNode[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region src/lib/rich-text.ts
|
|
2
|
+
var e = /declarion:\/\/file\/([0-9a-fA-F-]{36})/g;
|
|
3
|
+
function t(e) {
|
|
4
|
+
return typeof e == "string" ? e : l(e) && typeof e.markdown == "string" ? e.markdown : "";
|
|
5
|
+
}
|
|
6
|
+
function n(e, n) {
|
|
7
|
+
return {
|
|
8
|
+
markdown: t(e),
|
|
9
|
+
files: a(n)
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function r(e, t) {
|
|
13
|
+
let r = n(e, null);
|
|
14
|
+
return r.files[t.id] = t, r;
|
|
15
|
+
}
|
|
16
|
+
function i(e, t) {
|
|
17
|
+
let r = n(e, null);
|
|
18
|
+
for (let e of t) delete r.files[e];
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
function a(e) {
|
|
22
|
+
if (!Array.isArray(e)) return {};
|
|
23
|
+
let t = {};
|
|
24
|
+
for (let n of e) l(n) && typeof n.id == "string" && (t[n.id] = n);
|
|
25
|
+
return t;
|
|
26
|
+
}
|
|
27
|
+
function o(t) {
|
|
28
|
+
let n = /* @__PURE__ */ new Set(), r = [], i;
|
|
29
|
+
for (e.lastIndex = 0; (i = e.exec(t)) !== null;) {
|
|
30
|
+
let e = i[1];
|
|
31
|
+
n.has(e) || (n.add(e), r.push(e));
|
|
32
|
+
}
|
|
33
|
+
return r;
|
|
34
|
+
}
|
|
35
|
+
function s(e) {
|
|
36
|
+
return e ? /^declarion:\/\/file\/([0-9a-fA-F-]{36})$/.exec(e)?.[1] ?? null : null;
|
|
37
|
+
}
|
|
38
|
+
function c(e) {
|
|
39
|
+
let t = `declarion://file/${e.id}`;
|
|
40
|
+
return e.content_type.startsWith("image/") ? `` : `[${e.filename || e.id}](${t})`;
|
|
41
|
+
}
|
|
42
|
+
function l(e) {
|
|
43
|
+
return typeof e == "object" && !!e;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { c as a, t as i, s as n, r as o, o as r, i as s, n as t };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=rich-text-CaQ6-8Gx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-CaQ6-8Gx.js","names":[],"sources":["../src/lib/rich-text.ts"],"sourcesContent":["import type { HydratedFile } from \"@/types/files\";\n\nexport interface RichTextValue {\n markdown: string;\n files: Record<string, HydratedFile>;\n}\n\nconst declarionFilePattern = /declarion:\\/\\/file\\/([0-9a-fA-F-]{36})/g;\n\nexport function richTextMarkdown(value: unknown): string {\n if (typeof value === \"string\") return value;\n if (isRecord(value) && typeof value.markdown === \"string\") return value.markdown;\n return \"\";\n}\n\nexport function richTextFiles(value: unknown): Record<string, HydratedFile> {\n if (!isRecord(value) || !isRecord(value.files)) return {};\n const files: Record<string, HydratedFile> = {};\n for (const [fileId, file] of Object.entries(value.files)) {\n if (isRecord(file) && typeof file.id === \"string\") {\n files[fileId] = file as unknown as HydratedFile;\n }\n }\n return files;\n}\n\nexport function createRichTextValue(markdownValue: unknown, inlineFilesValue: unknown): RichTextValue {\n return {\n markdown: richTextMarkdown(markdownValue),\n files: inlineFilesById(inlineFilesValue),\n };\n}\n\nexport function withRichTextFile(value: unknown, file: HydratedFile): RichTextValue {\n const next = createRichTextValue(value, null);\n next.files[file.id] = file;\n return next;\n}\n\nexport function withoutRichTextFiles(value: unknown, removedIds: Iterable<string>): RichTextValue {\n const next = createRichTextValue(value, null);\n for (const fileId of removedIds) delete next.files[fileId];\n return next;\n}\n\nexport function inlineFilesById(value: unknown): Record<string, HydratedFile> {\n if (!Array.isArray(value)) return {};\n const files: Record<string, HydratedFile> = {};\n for (const item of value) {\n if (isRecord(item) && typeof item.id === \"string\") {\n files[item.id] = item as unknown as HydratedFile;\n }\n }\n return files;\n}\n\nexport function extractDeclarionFileIds(markdown: string): string[] {\n const seen = new Set<string>();\n const ids: string[] = [];\n let match: RegExpExecArray | null;\n declarionFilePattern.lastIndex = 0;\n while ((match = declarionFilePattern.exec(markdown)) !== null) {\n const fileId = match[1];\n if (seen.has(fileId)) continue;\n seen.add(fileId);\n ids.push(fileId);\n }\n return ids;\n}\n\nexport function extractDeclarionFileId(url: string | undefined): string | null {\n if (!url) return null;\n const match = /^declarion:\\/\\/file\\/([0-9a-fA-F-]{36})$/.exec(url);\n return match?.[1] ?? null;\n}\n\nexport function richTextTokenForFile(file: Pick<HydratedFile, \"id\" | \"content_type\" | \"filename\">): string {\n const ref = `declarion://file/${file.id}`;\n if (file.content_type.startsWith(\"image/\")) return ``;\n const label = file.filename || file.id;\n return `[${label}](${ref})`;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n"],"mappings":";AAOA,IAAM,IAAuB;AAE7B,SAAgB,EAAiB,GAAwB;AAGvD,QAFI,OAAO,KAAU,WAAiB,IAClC,EAAS,EAAM,IAAI,OAAO,EAAM,YAAa,WAAiB,EAAM,WACjE;;AAcT,SAAgB,EAAoB,GAAwB,GAA0C;AACpG,QAAO;EACL,UAAU,EAAiB,EAAc;EACzC,OAAO,EAAgB,EAAiB;EACzC;;AAGH,SAAgB,EAAiB,GAAgB,GAAmC;CAClF,IAAM,IAAO,EAAoB,GAAO,KAAK;AAE7C,QADA,EAAK,MAAM,EAAK,MAAM,GACf;;AAGT,SAAgB,EAAqB,GAAgB,GAA6C;CAChG,IAAM,IAAO,EAAoB,GAAO,KAAK;AAC7C,MAAK,IAAM,KAAU,EAAY,QAAO,EAAK,MAAM;AACnD,QAAO;;AAGT,SAAgB,EAAgB,GAA8C;AAC5E,KAAI,CAAC,MAAM,QAAQ,EAAM,CAAE,QAAO,EAAE;CACpC,IAAM,IAAsC,EAAE;AAC9C,MAAK,IAAM,KAAQ,EACjB,CAAI,EAAS,EAAK,IAAI,OAAO,EAAK,MAAO,aACvC,EAAM,EAAK,MAAM;AAGrB,QAAO;;AAGT,SAAgB,EAAwB,GAA4B;CAClE,IAAM,oBAAO,IAAI,KAAa,EACxB,IAAgB,EAAE,EACpB;AAEJ,MADA,EAAqB,YAAY,IACzB,IAAQ,EAAqB,KAAK,EAAS,MAAM,OAAM;EAC7D,IAAM,IAAS,EAAM;AACjB,IAAK,IAAI,EAAO,KACpB,EAAK,IAAI,EAAO,EAChB,EAAI,KAAK,EAAO;;AAElB,QAAO;;AAGT,SAAgB,EAAuB,GAAwC;AAG7E,QAFK,IACS,2CAA2C,KAAK,EAAI,GACnD,MAAM,OAFJ;;AAKnB,SAAgB,EAAqB,GAAsE;CACzG,IAAM,IAAM,oBAAoB,EAAK;AAGrC,QAFI,EAAK,aAAa,WAAW,SAAS,GAAS,OAAO,EAAI,KAEvD,IADO,EAAK,YAAY,EAAK,GACnB,IAAI,EAAI;;AAG3B,SAAS,EAAS,GAAkD;AAClE,QAAO,OAAO,KAAU,cAAY"}
|
|
@@ -30,5 +30,6 @@ interface TabState {
|
|
|
30
30
|
setScope: (tenantId: string | null, userId: string | null) => void;
|
|
31
31
|
hydrate: () => void;
|
|
32
32
|
}
|
|
33
|
+
export declare function peekTenantLandingPath(tenantId: string, userId: string): string | null;
|
|
33
34
|
export declare const useTabStore: import("zustand").UseBoundStore<import("zustand").StoreApi<TabState>>;
|
|
34
35
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type FieldType = "uuid" | "string" | "text" | "rich_text" | "int" | "float" | "bool" | "date" | "time" | "timestamp" | "email" | "url" | "phone" | "enum" | "json" | "ref" | "tags" | "multilang" | "multilang_text" | "structure" | "secret" | "password" | "decimal" | "string_array" | "int_array" | "bytes";
|
|
1
|
+
export type FieldType = "uuid" | "string" | "text" | "rich_text" | "int" | "float" | "bool" | "date" | "time" | "timestamp" | "email" | "url" | "phone" | "enum" | "json" | "ref" | "tags" | "multilang" | "multilang_text" | "structure" | "secret" | "password" | "decimal" | "string_array" | "int_array" | "uuid_array" | "bytes";
|
|
2
2
|
export declare const FIELD_TYPES: readonly FieldType[];
|