@panneau/forms 5.0.0-alpha.28 → 5.0.0-alpha.29

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.
@@ -0,0 +1,87 @@
1
+ import { messages } from "../messages.js";
2
+ import Form_module_default from "../Form.module.js";
3
+ import { cx } from "../cx.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { Button, Icon, Tooltip, isApplePlatform, usePanneauIntl } from "@panneau/ui";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { createContext } from "react";
8
+ import { CircleCheck } from "lucide-react";
9
+ //#region src/panels/SaveControls.tsx
10
+ /** What the `save` panel shows, from its `FormView` (decision 0075). */
11
+ var SaveContext = createContext(null);
12
+ /** What the `errors` panel shows, from its `FormView` (decision 0075). */
13
+ var SummaryContext = createContext(null);
14
+ /**
15
+ * The status of a form, its actions and its Save button: in its footer, or in the `save` panel of
16
+ * its sidebar.
17
+ */
18
+ function SaveControls(t0) {
19
+ const $ = c(17);
20
+ const { status, isSubmitting, actions, submitLabel } = t0;
21
+ const intl = usePanneauIntl();
22
+ let t1;
23
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
24
+ t1 = isApplePlatform();
25
+ $[0] = t1;
26
+ } else t1 = $[0];
27
+ const apple = t1;
28
+ const t2 = status === "error" && Form_module_default.statusError;
29
+ let t3;
30
+ if ($[1] !== t2) {
31
+ t3 = cx(Form_module_default.status, t2);
32
+ $[1] = t2;
33
+ $[2] = t3;
34
+ } else t3 = $[2];
35
+ let t4;
36
+ if ($[3] !== intl || $[4] !== status) {
37
+ t4 = status === "error" ? intl.formatMessage(messages.saveFailed) : status === "unsaved" ? intl.formatMessage(messages.unsaved) : status === "saved" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, { icon: CircleCheck }), intl.formatMessage(messages.saved)] }) : null;
38
+ $[3] = intl;
39
+ $[4] = status;
40
+ $[5] = t4;
41
+ } else t4 = $[5];
42
+ let t5;
43
+ if ($[6] !== t3 || $[7] !== t4) {
44
+ t5 = /* @__PURE__ */ jsx("span", {
45
+ className: t3,
46
+ role: "status",
47
+ children: t4
48
+ });
49
+ $[6] = t3;
50
+ $[7] = t4;
51
+ $[8] = t5;
52
+ } else t5 = $[8];
53
+ let t6;
54
+ if ($[9] !== intl || $[10] !== isSubmitting || $[11] !== submitLabel) {
55
+ t6 = submitLabel !== null ? /* @__PURE__ */ jsx(Tooltip, {
56
+ content: intl.formatMessage(messages.saveShortcut, { modifier: apple ? "⌘" : "Ctrl" }),
57
+ children: /* @__PURE__ */ jsx(Button, {
58
+ type: "submit",
59
+ variant: "primary",
60
+ isPending: isSubmitting,
61
+ "aria-keyshortcuts": apple ? "Meta+Enter" : "Control+Enter",
62
+ children: submitLabel ?? intl.formatMessage(messages.save)
63
+ })
64
+ }) : null;
65
+ $[9] = intl;
66
+ $[10] = isSubmitting;
67
+ $[11] = submitLabel;
68
+ $[12] = t6;
69
+ } else t6 = $[12];
70
+ let t7;
71
+ if ($[13] !== actions || $[14] !== t5 || $[15] !== t6) {
72
+ t7 = /* @__PURE__ */ jsxs(Fragment, { children: [
73
+ t5,
74
+ actions,
75
+ t6
76
+ ] });
77
+ $[13] = actions;
78
+ $[14] = t5;
79
+ $[15] = t6;
80
+ $[16] = t7;
81
+ } else t7 = $[16];
82
+ return t7;
83
+ }
84
+ //#endregion
85
+ export { SaveContext, SaveControls, SummaryContext };
86
+
87
+ //# sourceMappingURL=SaveControls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveControls.js","names":["CircleCheck","ReactNode","createContext","Field","Button","Icon","Tooltip","isApplePlatform","usePanneauIntl","styles","cx","messages","SaveState","status","isSubmitting","actions","submitLabel","SummaryState","errors","Record","fields","onSelect","path","SaveContext","SummaryContext","SaveControls","t0","$","_c","intl","t1","Symbol","for","apple","t2","statusError","t3","t4","formatMessage","saveFailed","unsaved","saved","t5","t6","saveShortcut","modifier","save","t7","_c","styles","_Fragment"],"sources":["../../src/panels/SaveControls.tsx"],"sourcesContent":["import { CircleCheck } from 'lucide-react';\nimport { type ReactNode, createContext } from 'react';\n\nimport type { Field } from '@panneau/protocol';\nimport { Button, Icon, Tooltip, isApplePlatform, usePanneauIntl } from '@panneau/ui';\n\nimport styles from '../Form.module.css';\nimport { cx } from '../cx';\nimport { messages } from '../messages';\n\nexport interface SaveState {\n /** What the status says: the failure of the last save, unsaved changes, or \"Saved\". */\n status: 'error' | 'unsaved' | 'saved' | null;\n isSubmitting: boolean;\n /** The form's `actions`, next to its button. */\n actions: ReactNode;\n /** The label of the submit button, or `null` without one. */\n submitLabel: ReactNode;\n}\n\nexport interface SummaryState {\n /** Errors by path, in the order of their fields, after a failed save. Empty otherwise. */\n errors: Record<string, string[]>;\n fields: readonly Field[];\n onSelect: (path: string) => void;\n}\n\n/** What the `save` panel shows, from its `FormView` (decision 0075). */\nexport const SaveContext = createContext<SaveState | null>(null);\n\n/** What the `errors` panel shows, from its `FormView` (decision 0075). */\nexport const SummaryContext = createContext<SummaryState | null>(null);\n\n/**\n * The status of a form, its actions and its Save button: in its footer, or in the `save` panel of\n * its sidebar.\n */\nexport function SaveControls({ status, isSubmitting, actions, submitLabel }: SaveState) {\n const intl = usePanneauIntl();\n const apple = isApplePlatform();\n return (\n <>\n <span\n className={cx(styles.status, status === 'error' && styles.statusError)}\n role=\"status\"\n >\n {status === 'error' ? (\n intl.formatMessage(messages.saveFailed)\n ) : status === 'unsaved' ? (\n intl.formatMessage(messages.unsaved)\n ) : status === 'saved' ? (\n <>\n <Icon icon={CircleCheck} />\n {intl.formatMessage(messages.saved)}\n </>\n ) : null}\n </span>\n {actions}\n {submitLabel !== null ? (\n <Tooltip\n content={intl.formatMessage(messages.saveShortcut, {\n modifier: apple ? '⌘' : 'Ctrl',\n })}\n >\n <Button\n type=\"submit\"\n variant=\"primary\"\n isPending={isSubmitting}\n aria-keyshortcuts={apple ? 'Meta+Enter' : 'Control+Enter'}\n >\n {submitL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E,CAAA;EAAAV,EAAA,KAAAS;EAAAT,EAAA,KAAAU;EAAAV,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,OAAAE,QAAAF,EAAA,QAAAb,gBAAAa,EAAA,QAAAX,aAAA;EAEN2B,KAAA3B,gBAAgB,OACb,oBAAC,SAAD;GACa,SAAAa,KAAIS,cAAe3B,SAAQiC,cAAe,EAAAC,UACrCZ,QAAA,MAAA,OACd,CAAC;GAED,UAAA,oBAAC,QAAD;IACS,MAAA;IACG,SAAA;IACGnB,WAAAA;IACQ,qBAAAmB,QAAA,eAAA;IAElBjB,UAAAA,eAAea,KAAIS,cAAe3B,SAAQmC,IAAK;GAN7C,CAAA;EALH,CAAA,IADX;EAeOnB,EAAA,KAAAE;EAAAF,EAAA,MAAAb;EAAAa,EAAA,MAAAX;EAAAW,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,IAAAoB;CAAA,IAAApB,EAAA,QAAAZ,WAAAY,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,IAAA;EAhCZI,KAAA,qBAAAG,UAAA,EAAA,UAAA;GACIR;GAeC3B;GACA4B;EAeO,EAAA,CAAA;EACThB,EAAA,MAAAZ;EAAAY,EAAA,MAAAe;EAAAf,EAAA,MAAAgB;EAAAhB,EAAA,MAAAoB;CAAA,OAAAA,KAAApB,EAAA;CAAA,OAjCHoB;AAiCG"}
@@ -0,0 +1,34 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import type { Form } from '@panneau/core';
3
+ import type { Field, LayoutNode } from '@panneau/protocol';
4
+ /**
5
+ * What the component of a panel of a form's sidebar gets (decision 0075), with the `props` of its
6
+ * node: a `sidebar` node with a `panel`. Its title is the node's `label`, which the aside shows.
7
+ */
8
+ export interface FormPanelProps {
9
+ node: LayoutNode;
10
+ form: Form;
11
+ /** The fields of the form, by name. */
12
+ fields: ReadonlyMap<string, Field>;
13
+ /** The node's children, rendered: the fields the panel holds. */
14
+ children: ReactNode;
15
+ }
16
+ /** A component of a panel: built in, of a plugin, or of `Form`'s `panels`. */
17
+ export type FormPanelComponent = ComponentType<FormPanelProps>;
18
+ /**
19
+ * The `save` panel: the state of the form, its actions and its Save button. It shows beside the
20
+ * form only, where the form has no footer (decision 0075).
21
+ */
22
+ export declare function SavePanel(): ReactNode;
23
+ /**
24
+ * The `errors` panel: the errors of the form after a failed save, each a link to its field. It
25
+ * shows beside the form only, where the form has no summary at the top (decision 0075).
26
+ */
27
+ export declare function ErrorsPanel(): ReactNode;
28
+ /** The panels of `@panneau/forms`, which plugins and `Form`'s `panels` can override. */
29
+ export declare const builtInPanels: Readonly<Record<string, FormPanelComponent>>;
30
+ /** The panels of a form, by name: built in, then of plugins, then of `Form`'s `panels`. */
31
+ export declare const PanelsContext: import("react").Context<ReadonlyMap<string, FormPanelComponent>>;
32
+ /** The panels that show only beside the form: below it, the footer and the summary do their work. */
33
+ export declare const BESIDE_ONLY_PANELS: ReadonlySet<string>;
34
+ //# sourceMappingURL=panels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/panels/panels.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAC;AAE/E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,uCAAuC;IACvC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,8EAA8E;AAC9E,MAAM,MAAM,kBAAkB,GAAG,aAAa,CAAC,cAAc,CAAC,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,SAAS,IAAI,SAAS,CAUrC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,SAAS,CAQvC;AAED,wFAAwF;AACxF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAGtE,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,aAAa,kEAEzB,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAA+B,CAAC"}
@@ -0,0 +1,61 @@
1
+ import Form_module_default from "../Form.module.js";
2
+ import { ErrorSummary } from "../ErrorSummary.js";
3
+ import { SaveContext, SaveControls, SummaryContext } from "./SaveControls.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { createContext, use } from "react";
7
+ //#region src/panels/panels.tsx
8
+ /**
9
+ * The `save` panel: the state of the form, its actions and its Save button. It shows beside the
10
+ * form only, where the form has no footer (decision 0075).
11
+ */
12
+ function SavePanel() {
13
+ const $ = c(2);
14
+ const save = use(SaveContext);
15
+ if (save === null) return null;
16
+ let t0;
17
+ if ($[0] !== save) {
18
+ t0 = /* @__PURE__ */ jsx("div", {
19
+ className: Form_module_default.savePanel,
20
+ children: /* @__PURE__ */ jsx(SaveControls, { ...save })
21
+ });
22
+ $[0] = save;
23
+ $[1] = t0;
24
+ } else t0 = $[1];
25
+ return t0;
26
+ }
27
+ /**
28
+ * The `errors` panel: the errors of the form after a failed save, each a link to its field. It
29
+ * shows beside the form only, where the form has no summary at the top (decision 0075).
30
+ */
31
+ function ErrorsPanel() {
32
+ const $ = c(4);
33
+ const summary = use(SummaryContext);
34
+ if (summary === null) return null;
35
+ let t0;
36
+ if ($[0] !== summary.errors || $[1] !== summary.fields || $[2] !== summary.onSelect) {
37
+ t0 = /* @__PURE__ */ jsx(ErrorSummary, {
38
+ errors: summary.errors,
39
+ fields: summary.fields,
40
+ onSelect: summary.onSelect
41
+ });
42
+ $[0] = summary.errors;
43
+ $[1] = summary.fields;
44
+ $[2] = summary.onSelect;
45
+ $[3] = t0;
46
+ } else t0 = $[3];
47
+ return t0;
48
+ }
49
+ /** The panels of `@panneau/forms`, which plugins and `Form`'s `panels` can override. */
50
+ var builtInPanels = {
51
+ save: SavePanel,
52
+ errors: ErrorsPanel
53
+ };
54
+ /** The panels of a form, by name: built in, then of plugins, then of `Form`'s `panels`. */
55
+ var PanelsContext = createContext(new Map(Object.entries(builtInPanels)));
56
+ /** The panels that show only beside the form: below it, the footer and the summary do their work. */
57
+ var BESIDE_ONLY_PANELS = /* @__PURE__ */ new Set(["save", "errors"]);
58
+ //#endregion
59
+ export { BESIDE_ONLY_PANELS, ErrorsPanel, PanelsContext, SavePanel, builtInPanels };
60
+
61
+ //# sourceMappingURL=panels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"panels.js","names":["ComponentType","ReactNode","createContext","use","Form","Field","LayoutNode","ErrorSummary","styles","SaveContext","SaveControls","SummaryContext","FormPanelProps","node","form","fields","ReadonlyMap","children","FormPanelComponent","SavePanel","$","_c","save","t0","savePanel","ErrorsPanel","summary","errors","onSelect","builtInPanels","Readonly","Record","PanelsContext","Map","Object","entries","BESIDE_ONLY_PANELS","ReadonlySet","Set","_c","styles"],"sources":["../../src/panels/panels.tsx"],"sourcesContent":["import { type ComponentType, type ReactNode, createContext, use } from 'react';\n\nimport type { Form } from '@panneau/core';\nimport type { Field, LayoutNode } from '@panneau/protocol';\n\nimport { ErrorSummary } from '../ErrorSummary';\nimport styles from '../Form.module.css';\nimport { SaveContext, SaveControls, SummaryContext } from './SaveControls';\n\n/**\n * What the component of a panel of a form's sidebar gets (decision 0075), with the `props` of its\n * node: a `sidebar` node with a `panel`. Its title is the node's `label`, which the aside shows.\n */\nexport interface FormPanelProps {\n node: LayoutNode;\n form: Form;\n /** The fields of the form, by name. */\n fields: ReadonlyMap<string, Field>;\n /** The node's children, rendered: the fields the panel holds. */\n children: ReactNode;\n}\n\n/** A component of a panel: built in, of a plugin, or of `Form`'s `panels`. */\nexport type FormPanelComponent = ComponentType<FormPanelProps>;\n\n/**\n * The `save` panel: the state of the form, its actions and its Save button. It shows beside the\n * form only, where the form has no footer (decision 0075).\n */\nexport function SavePanel(): ReactNode {\n const save = use(SaveContext);\n if (save === null) {\n return null;\n }\n return (\n <div className={styles.savePanel}>\n <SaveControls {...save} />\n </div>\n );\n}\n\n/**\n * The `errors` panel: the errors of the form after a failed save, each a link to its field. It\n * shows beside the form only, where the form has no summary at the top (decision 0075).\n */\nexport function ErrorsPanel(): ReactNode {\n const summary = use(SummaryContext);\n if (summary === null) {\n return null;\n }\n return (\n <ErrorSummary errors={summary.errors} fields={summary.fields} onSelect={summary.onSelect} />\n );\n}\n\n/** The panels of `@panneau/forms`, which plugins and `Form`'s `panels` can override. */\nexport const builtInPanels: Readonly<Record<string, FormPanelComponent>> = {\n save: SavePanel,\n errors: ErrorsPanel,\n};\n\n/** The panels of a form, by name: built in, then of plugins, then of `Form`'s `panels`. */\nexport const PanelsContext = createContext<ReadonlyMap<string, FormPanelComponent>>(\n new Map(Object.entries(builtInPanels)),\n);\n\n/** The panels that show only beside the form: below it, the footer and the summary do their work. */\nexport const BESIDE_ONLY_PANELS: ReadonlySet<string> = new Set(['save', 'errors']);\n"],"mappings":";;;;;;;;;;;AA6BA,SAAOmB,YAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CACH,MAAAC,OAAanB,IAAIM,WAAW;CAC5B,IAAIa,SAAS,MAAI,OACN;CACV,IAAAC;CAAA,IAAAH,EAAA,OAAAE,MAAA;EAEGC,KAAA,oBAAA,OAAA;GAAgB,WAAAf,oBAAMgB;GAClB,UAAA,oBAAC,cAAD,EAAa,GAAKF,KAAI,CAAA;EACpB,CAAA;EAAAF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAFNG;AAEM;;;;;AAQd,SAAOE,cAAA;CAAA,MAAAL,IAAAC,EAAA,CAAA;CACH,MAAAK,UAAgBvB,IAAIQ,cAAc;CAClC,IAAIe,YAAY,MAAI,OACT;CACV,IAAAH;CAAA,IAAAH,EAAA,OAAAM,QAAAC,UAAAP,EAAA,OAAAM,QAAAX,UAAAK,EAAA,OAAAM,QAAAE,UAAA;EAEGL,KAAA,oBAAC,cAAD;GAAsB,QAAAG,QAAOC;GAAiB,QAAAD,QAAOX;GAAmB,UAAAW,QAAOE;EAAS,CAAA;EAAIR,EAAA,KAAAM,QAAAC;EAAAP,EAAA,KAAAM,QAAAX;EAAAK,EAAA,KAAAM,QAAAE;EAAAR,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAA5FG;AAA4F;;AAKpG,IAAaM,gBAA8D;CACvEP,MAAMH;CACNQ,QAAQF;AACZ;;AAGA,IAAaO,gBAAgB9B,cACzB,IAAI+B,IAAIC,OAAOC,QAAQN,aAAa,CAAC,CACzC;;AAGA,IAAaO,qCAA0C,IAAIE,IAAI,CAAC,QAAQ,QAAQ,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { LayoutComponentProps } from '../layout/Layout.js';
2
+ import type { FormPanelProps } from '../panels/panels.js';
2
3
  export interface PublicationProps extends LayoutComponentProps {
3
4
  /** The field that says whether the item is published, a `boolean`. Defaults to `published`. */
4
5
  published?: string;
@@ -23,11 +24,34 @@ export interface PublicationProps extends LayoutComponentProps {
23
24
  * ```
24
25
  */
25
26
  export declare function Publication({ node, form, fields, children, published, publishedAt, status, }: PublicationProps): import("react").JSX.Element;
26
- /** The `publication` layout component, as a `@panneau/core` plugin. */
27
+ export interface PublicationPanelProps extends FormPanelProps {
28
+ /** The field that says whether the item is published, a `boolean`. Defaults to `published`. */
29
+ published?: string;
30
+ /** The field of the publication date, a `date` or a `datetime`. Defaults to `published_at`. */
31
+ publishedAt?: string;
32
+ /** The field of the status, a `select`. Defaults to `status`. */
33
+ status?: string;
34
+ /** The status that Publish sets, without a `published` field. Defaults to `published`. */
35
+ publishedStatus?: string;
36
+ /** The status that Unpublish sets, without a `published` field. Defaults to `draft`. */
37
+ draftStatus?: string;
38
+ }
39
+ /**
40
+ * The `publication` panel of a form's sidebar (decision 0075): the state of the item, as the
41
+ * `publication` component shows it, its fields, and a Publish button, or Unpublish once it is
42
+ * published, which sets the publication and saves. Publishing sets `published` to `true`, or else
43
+ * the status to `publishedStatus`, and the date to now when it is empty. Without a `published`
44
+ * field nor a status with the option, the panel has no button.
45
+ */
46
+ export declare function PublicationPanel({ form, fields, children, published, publishedAt, status, publishedStatus, draftStatus, }: PublicationPanelProps): import("react").JSX.Element;
47
+ /** The `publication` layout component and panel, as a `@panneau/core` plugin. */
27
48
  export declare const publicationPlugin: {
28
49
  id: string;
29
50
  components: {
30
51
  publication: typeof Publication;
31
52
  };
53
+ panels: {
54
+ publication: typeof PublicationPanel;
55
+ };
32
56
  };
33
57
  //# sourceMappingURL=Publication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Publication.d.ts","sourceRoot":"","sources":["../../src/publication/Publication.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC1D,+FAA+F;IAC/F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,EACxB,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAuB,EACvB,WAA4B,EAC5B,MAAiB,GACpB,EAAE,gBAAgB,+BA8DlB;AAED,uEAAuE;AACvE,eAAO,MAAM,iBAAiB;;;;;CAG7B,CAAC"}
1
+ {"version":3,"file":"Publication.d.ts","sourceRo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