@declarion/react 0.1.79 → 0.1.81
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-XKJWMb1S.js +281 -0
- package/dist-lib/DraggableChildrenTable-XKJWMb1S.js.map +1 -0
- package/dist-lib/Grid-By_Ere-W.js +405 -0
- package/dist-lib/Grid-By_Ere-W.js.map +1 -0
- package/dist-lib/{JsonEditor-CWueGEgA.js → JsonEditor-CexL5HXN.js} +17 -15
- package/dist-lib/JsonEditor-CexL5HXN.js.map +1 -0
- package/dist-lib/MarkdownRenderer-Dl3GDuY9.js +72 -0
- package/dist-lib/MarkdownRenderer-Dl3GDuY9.js.map +1 -0
- package/dist-lib/api/events.d.ts +5 -0
- package/dist-lib/components/detail-layout/index.d.ts +0 -1
- package/dist-lib/components/fields/BoolField.d.ts +1 -1
- package/dist-lib/components/fields/EmailField.d.ts +1 -1
- package/dist-lib/components/fields/EnumField.d.ts +1 -1
- package/dist-lib/components/fields/IntArrayField.d.ts +1 -1
- package/dist-lib/components/fields/JsonEditor.d.ts +2 -1
- package/dist-lib/components/fields/JsonField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangField.d.ts +1 -1
- package/dist-lib/components/fields/MultilangTextField.d.ts +1 -1
- package/dist-lib/components/fields/NumberField.d.ts +1 -1
- package/dist-lib/components/fields/PasswordField.d.ts +1 -1
- package/dist-lib/components/fields/PhoneField.d.ts +1 -1
- package/dist-lib/components/fields/RefField.d.ts +1 -1
- package/dist-lib/components/fields/SecretField.d.ts +1 -1
- package/dist-lib/components/fields/StringArrayField.d.ts +1 -1
- package/dist-lib/components/fields/StringField.d.ts +1 -1
- package/dist-lib/components/fields/TextField.d.ts +1 -1
- package/dist-lib/components/fields/TimestampField.d.ts +1 -1
- package/dist-lib/components/fields/UrlField.d.ts +1 -1
- package/dist-lib/components/fields/cells/factories/markdownToPlainText.d.ts +7 -14
- package/dist-lib/components/fields/index.d.ts +2 -0
- package/dist-lib/components/file-widgets/GridLazy.d.ts +2 -0
- package/dist-lib/components/file-widgets/host.d.ts +2 -0
- package/dist-lib/components/file-widgets/index.d.ts +1 -1
- package/dist-lib/components/file-widgets/types.d.ts +1 -0
- package/dist-lib/components/pages/list/DataCell.d.ts +7 -0
- package/dist-lib/components/pages/list/ListBulkBar.d.ts +27 -0
- package/dist-lib/components/pages/list/ListHeader.d.ts +23 -0
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +38 -0
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +6 -0
- package/dist-lib/components/pages/list/columns.d.ts +42 -0
- package/dist-lib/components/pages/list/filter-meta.d.ts +9 -0
- package/dist-lib/components/primitives/BoolToggle.d.ts +3 -1
- package/dist-lib/components/primitives/Fields.d.ts +12 -3
- 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 +12549 -19381
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/lib/action-dispatch.d.ts +7 -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/realtime.d.ts +9 -0
- package/dist-lib/stores/tabs.d.ts +1 -0
- package/dist-lib/types/schema.d.ts +11 -1
- package/dist-lib/useUserLocale-CSS6fwi8.js +5830 -0
- package/dist-lib/useUserLocale-CSS6fwi8.js.map +1 -0
- package/dist-lib/value-DgzPSFZM.js +524 -0
- package/dist-lib/value-DgzPSFZM.js.map +1 -0
- package/package.json +3 -2
- package/dist-lib/JsonEditor-CWueGEgA.js.map +0 -1
- package/dist-lib/components/shared/RowActionItem.d.ts +0 -11
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type UIActionContext } from "../lib/ui-actions";
|
|
2
|
+
import type { UIStep } from "../types/schema";
|
|
3
|
+
export declare function dispatchAction(code: string, action: {
|
|
4
|
+
ui_steps?: UIStep[];
|
|
5
|
+
handler?: string;
|
|
6
|
+
entity?: string;
|
|
7
|
+
}, uiContext: UIActionContext, entityFallback?: string): string | null;
|
|
@@ -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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface RealtimeState {
|
|
2
|
+
/** Entity codes the relay auto-degraded this session. */
|
|
3
|
+
degradedEntities: ReadonlySet<string>;
|
|
4
|
+
/** Mark one entity as auto-degraded. Idempotent. */
|
|
5
|
+
markDegraded: (entityCode: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const useRealtimeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<RealtimeState>>;
|
|
8
|
+
export declare function isEntityLive(realtimeFlag: boolean | undefined, degradedEntities: ReadonlySet<string>, entityCode: string): boolean;
|
|
9
|
+
export {};
|
|
@@ -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 {};
|
|
@@ -28,7 +28,7 @@ export declare function getDisplayValue(row: Record<string, unknown> | null | un
|
|
|
28
28
|
};
|
|
29
29
|
} | null | undefined): string | undefined;
|
|
30
30
|
export declare function resolveRefRecordLabel(record: Record<string, unknown>, displayField: string | undefined, fallback: string): string;
|
|
31
|
-
export declare function screenTitleForPath(pathname: string, screens: Record<string, Screen> | undefined): {
|
|
31
|
+
export declare function screenTitleForPath(pathname: string, screens: Record<string, Screen> | undefined, entities?: Record<string, Entity>): {
|
|
32
32
|
title: string;
|
|
33
33
|
icon?: string;
|
|
34
34
|
} | undefined;
|
|
@@ -274,6 +274,16 @@ export interface Entity {
|
|
|
274
274
|
* Server delivers RBAC-pruned nodes in tagged-union wire format (plan §8).
|
|
275
275
|
*/
|
|
276
276
|
action_layout?: ActionLayoutNode[];
|
|
277
|
+
/**
|
|
278
|
+
* Per-entity realtime opt-in. When true the entity is in the CDC
|
|
279
|
+
* publication, its list views auto-update from the SSE stream, and the
|
|
280
|
+
* toolbar shows a green "Live" indicator. Absent or false (default OFF)
|
|
281
|
+
* means the entity is not live: no indicator, and the always-present
|
|
282
|
+
* manual refresh control is the only freshness mechanism. Server emits
|
|
283
|
+
* this with `omitempty`, so `false` arrives as absent. See
|
|
284
|
+
* docs/plans/completed/2026-05-18-realtime-cdc-redesign.md.
|
|
285
|
+
*/
|
|
286
|
+
realtime?: boolean;
|
|
277
287
|
}
|
|
278
288
|
export interface ExportConfig {
|
|
279
289
|
enabled?: boolean;
|