@drawnagency/primitives 0.1.107 → 0.1.109
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/{chunk-PZJL2S3Z.js → chunk-3ZRQ4G5F.js} +1 -1
- package/dist/{chunk-LUAI5DWR.js → chunk-5PVRACZY.js} +2 -2
- package/dist/{chunk-IPKZ5FU6.js → chunk-67ZOQCUD.js} +7 -7
- package/dist/chunk-F2LYQPXV.js +77 -0
- package/dist/{chunk-JIQBLG6Y.js → chunk-LQHYVPBS.js} +6 -6
- package/dist/{chunk-ZHHJVKU7.js → chunk-WBDPDGFA.js} +59 -175
- package/dist/{chunk-5IZ2KTMU.js → chunk-WXBHP4JY.js} +1 -1
- package/dist/chunk-XIDE4TDF.js +194 -0
- package/dist/{chunk-D6TLUVOP.js → chunk-ZKVKNUJC.js} +47 -1
- package/dist/components/editor/index.js +4 -4
- package/dist/components/primitives/index.d.ts +2 -0
- package/dist/components/primitives/index.d.ts.map +1 -1
- package/dist/components/primitives/index.js +12 -5
- package/dist/components/sections/brand-guide.js +5 -5
- package/dist/components/sections/register-schemas.js +9 -9
- package/dist/components/sections/register.js +9 -9
- package/dist/components/shell/EditorShell.d.ts.map +1 -1
- package/dist/hooks/useEditorPublish.d.ts +2 -0
- package/dist/hooks/useEditorPublish.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/dexie.d.ts +25 -8
- package/dist/lib/dexie.d.ts.map +1 -1
- package/dist/lib/dexie.js +19 -17
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/link.d.ts.map +1 -1
- package/dist/schemas/link.js +1 -1
- package/package.json +1 -1
- package/src/components/primitives/index.ts +5 -0
- package/src/components/shared/LinkField.tsx +1 -1
- package/src/components/shell/EditorShell.tsx +64 -29
- package/src/hooks/useEditorPublish.ts +29 -4
- package/src/lib/dexie.ts +62 -28
- package/src/schemas/link.ts +4 -1
- package/dist/chunk-5THS4K5D.js +0 -123
- package/dist/chunk-ZSPCE6MZ.js +0 -70
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormLabel,
|
|
3
|
+
Input
|
|
4
|
+
} from "./chunk-ZKVKNUJC.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-7EOSDFS3.js";
|
|
8
|
+
|
|
9
|
+
// src/components/shared/PagesContext.tsx
|
|
10
|
+
import { createContext, useContext } from "react";
|
|
11
|
+
var PagesContext = createContext({ pages: [], getPageHeadings: () => [] });
|
|
12
|
+
function usePages() {
|
|
13
|
+
return useContext(PagesContext);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/components/shared/Select.tsx
|
|
17
|
+
import { useId } from "react";
|
|
18
|
+
import { ChevronDown } from "lucide-react";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
function Select({
|
|
21
|
+
label,
|
|
22
|
+
value,
|
|
23
|
+
onChange,
|
|
24
|
+
options,
|
|
25
|
+
disabled,
|
|
26
|
+
className,
|
|
27
|
+
selectClassName
|
|
28
|
+
}) {
|
|
29
|
+
const id = useId();
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
31
|
+
label && /* @__PURE__ */ jsx(FormLabel, { htmlFor: id, children: label }),
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
"select",
|
|
35
|
+
{
|
|
36
|
+
id,
|
|
37
|
+
value,
|
|
38
|
+
onChange: (e) => onChange(e.target.value),
|
|
39
|
+
disabled,
|
|
40
|
+
className: cn(
|
|
41
|
+
"w-full appearance-none rounded border border-base-200 bg-base py-2 pr-8 pl-3 text-sm text-base-contrast",
|
|
42
|
+
"focus:border-base-contrast focus:outline-none focus:ring-1 focus:ring-base-contrast",
|
|
43
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
44
|
+
selectClassName
|
|
45
|
+
),
|
|
46
|
+
children: options.map((opt) => /* @__PURE__ */ jsx("option", { value: opt.value, children: opt.label }, opt.value))
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
ChevronDown,
|
|
51
|
+
{
|
|
52
|
+
size: 14,
|
|
53
|
+
className: "pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-base-contrast-light"
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] })
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/components/shared/LinkField.tsx
|
|
61
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
62
|
+
var TARGET_OPTIONS = [
|
|
63
|
+
{ label: "Same tab (_self)", value: "_self" },
|
|
64
|
+
{ label: "New tab (_blank)", value: "_blank" }
|
|
65
|
+
];
|
|
66
|
+
function LinkField({ label, value, onChange }) {
|
|
67
|
+
const { pages, getPageHeadings } = usePages();
|
|
68
|
+
const isInternal = value.kind === "internal";
|
|
69
|
+
function setMode(kind) {
|
|
70
|
+
if (kind === value.kind) return;
|
|
71
|
+
onChange(kind === "external" ? { kind: "external", href: "", target: value.target } : { kind: "internal", pageId: "", anchorSectionId: null, target: "_self" });
|
|
72
|
+
}
|
|
73
|
+
const pageId = isInternal ? value.pageId : "";
|
|
74
|
+
const headings = pageId ? getPageHeadings(pageId) : [];
|
|
75
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-3", children: [
|
|
76
|
+
/* @__PURE__ */ jsx2(FormLabel, { children: label }),
|
|
77
|
+
/* @__PURE__ */ jsx2("div", { className: "flex gap-2", role: "tablist", children: ["internal", "external"].map((kind) => /* @__PURE__ */ jsx2(
|
|
78
|
+
"button",
|
|
79
|
+
{
|
|
80
|
+
type: "button",
|
|
81
|
+
role: "tab",
|
|
82
|
+
"aria-selected": value.kind === kind,
|
|
83
|
+
onClick: () => setMode(kind),
|
|
84
|
+
className: cn(
|
|
85
|
+
"cursor-pointer rounded border px-3 py-1 text-sm capitalize",
|
|
86
|
+
value.kind === kind ? "border-primary bg-primary text-primary-contrast" : "border-base-200 text-base-contrast"
|
|
87
|
+
),
|
|
88
|
+
children: kind === "external" ? "External URL" : "Internal page"
|
|
89
|
+
},
|
|
90
|
+
kind
|
|
91
|
+
)) }),
|
|
92
|
+
value.kind === "external" ? /* @__PURE__ */ jsx2(
|
|
93
|
+
Input,
|
|
94
|
+
{
|
|
95
|
+
label: "URL",
|
|
96
|
+
value: value.href,
|
|
97
|
+
placeholder: "https://...",
|
|
98
|
+
onChange: (href) => onChange({ kind: "external", href, target: value.target })
|
|
99
|
+
}
|
|
100
|
+
) : /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx2(
|
|
102
|
+
Select,
|
|
103
|
+
{
|
|
104
|
+
label: "Page",
|
|
105
|
+
value: value.pageId,
|
|
106
|
+
options: [{ label: "Select a page\u2026", value: "" }, ...pages.map((p) => ({ label: p.title, value: p.id }))],
|
|
107
|
+
onChange: (pid) => onChange({ kind: "internal", pageId: pid, anchorSectionId: null, target: value.target })
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsx2(
|
|
111
|
+
Select,
|
|
112
|
+
{
|
|
113
|
+
label: "Section",
|
|
114
|
+
value: value.anchorSectionId ?? "",
|
|
115
|
+
disabled: !pageId,
|
|
116
|
+
options: [{ label: "None (top of page)", value: "" }, ...headings.map((h) => ({ label: h.label, value: h.id }))],
|
|
117
|
+
onChange: (anchor) => onChange({ kind: "internal", pageId, anchorSectionId: anchor || null, target: value.target })
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] }),
|
|
121
|
+
value.kind === "external" && /* @__PURE__ */ jsx2(
|
|
122
|
+
Select,
|
|
123
|
+
{
|
|
124
|
+
label: "Opens in",
|
|
125
|
+
value: value.target,
|
|
126
|
+
options: TARGET_OPTIONS,
|
|
127
|
+
onChange: (t) => onChange({ ...value, target: t })
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// src/components/shared/Button.tsx
|
|
134
|
+
import { forwardRef } from "react";
|
|
135
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
136
|
+
var boxSize = {
|
|
137
|
+
sm: "rounded px-3 py-1.5 text-xs font-medium",
|
|
138
|
+
md: "rounded px-4 py-2 text-sm font-medium"
|
|
139
|
+
};
|
|
140
|
+
var ghostSize = {
|
|
141
|
+
sm: "text-xs font-medium",
|
|
142
|
+
md: "text-sm font-medium"
|
|
143
|
+
};
|
|
144
|
+
var variantClasses = {
|
|
145
|
+
primary: "bg-base-contrast text-base-accent hover:bg-base-contrast/90",
|
|
146
|
+
brand: "bg-primary text-primary-contrast hover:opacity-90",
|
|
147
|
+
secondary: "border border-base-200 text-base-contrast hover:bg-base-accent",
|
|
148
|
+
destructive: "border border-red-600 text-red-600 hover:bg-red-600 hover:text-white"
|
|
149
|
+
};
|
|
150
|
+
var ghostToneClasses = {
|
|
151
|
+
neutral: "text-base-contrast-light hover:text-base-contrast",
|
|
152
|
+
destructive: "text-red-600 hover:text-red-800"
|
|
153
|
+
};
|
|
154
|
+
var Button = forwardRef(function Button2({
|
|
155
|
+
variant = "primary",
|
|
156
|
+
size = "sm",
|
|
157
|
+
tone = "neutral",
|
|
158
|
+
fullWidth = false,
|
|
159
|
+
isLoading = false,
|
|
160
|
+
loadingLabel,
|
|
161
|
+
disabled,
|
|
162
|
+
className,
|
|
163
|
+
children,
|
|
164
|
+
...rest
|
|
165
|
+
}, ref) {
|
|
166
|
+
const isGhost = variant === "ghost";
|
|
167
|
+
const resolvedDisabled = disabled || isLoading;
|
|
168
|
+
const label = isLoading && loadingLabel ? loadingLabel : children;
|
|
169
|
+
return /* @__PURE__ */ jsx3(
|
|
170
|
+
"button",
|
|
171
|
+
{
|
|
172
|
+
ref,
|
|
173
|
+
disabled: resolvedDisabled,
|
|
174
|
+
className: cn(
|
|
175
|
+
"inline-flex items-center justify-center transition-colors",
|
|
176
|
+
isGhost ? ghostSize[size] : boxSize[size],
|
|
177
|
+
isGhost ? ghostToneClasses[tone] : variantClasses[variant],
|
|
178
|
+
fullWidth && "w-full",
|
|
179
|
+
resolvedDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
180
|
+
className
|
|
181
|
+
),
|
|
182
|
+
...rest,
|
|
183
|
+
children: label
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export {
|
|
189
|
+
Button,
|
|
190
|
+
PagesContext,
|
|
191
|
+
usePages,
|
|
192
|
+
Select,
|
|
193
|
+
LinkField
|
|
194
|
+
};
|
|
@@ -106,6 +106,50 @@ var IconButton = forwardRef(
|
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
+
// src/components/shared/FormLabel.tsx
|
|
110
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
111
|
+
function FormLabel({ htmlFor, children, className }) {
|
|
112
|
+
return /* @__PURE__ */ jsx3(
|
|
113
|
+
"label",
|
|
114
|
+
{
|
|
115
|
+
htmlFor,
|
|
116
|
+
className: cn("mb-1.5 block text-sm font-medium text-base-contrast", className),
|
|
117
|
+
children
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// src/components/shared/Input.tsx
|
|
123
|
+
import { forwardRef as forwardRef2, useId } from "react";
|
|
124
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
125
|
+
var Input = forwardRef2(function Input2({ label, value, onChange, type = "text", className, disabled, error, ...rest }, ref) {
|
|
126
|
+
const id = useId();
|
|
127
|
+
const errorId = `${id}-error`;
|
|
128
|
+
return /* @__PURE__ */ jsxs("div", { className, children: [
|
|
129
|
+
/* @__PURE__ */ jsx4(FormLabel, { htmlFor: id, children: label }),
|
|
130
|
+
/* @__PURE__ */ jsx4(
|
|
131
|
+
"input",
|
|
132
|
+
{
|
|
133
|
+
ref,
|
|
134
|
+
id,
|
|
135
|
+
type,
|
|
136
|
+
value,
|
|
137
|
+
onChange: (e) => onChange(e.target.value),
|
|
138
|
+
disabled,
|
|
139
|
+
"aria-invalid": error ? true : void 0,
|
|
140
|
+
"aria-describedby": error ? errorId : void 0,
|
|
141
|
+
className: cn(
|
|
142
|
+
"w-full rounded border bg-base px-3 py-2 text-sm text-base-contrast focus:outline-none focus:ring-1",
|
|
143
|
+
error ? "border-red-600 focus:border-red-600 focus:ring-red-600" : "border-base-200 focus:border-base-contrast focus:ring-base-contrast",
|
|
144
|
+
disabled && "cursor-not-allowed opacity-50"
|
|
145
|
+
),
|
|
146
|
+
...rest
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
error && /* @__PURE__ */ jsx4("p", { id: errorId, className: "mt-1 text-xs text-red-600", children: error })
|
|
150
|
+
] });
|
|
151
|
+
});
|
|
152
|
+
|
|
109
153
|
export {
|
|
110
154
|
useMediaLibrary,
|
|
111
155
|
useResolvedMedia,
|
|
@@ -113,5 +157,7 @@ export {
|
|
|
113
157
|
AddIcon,
|
|
114
158
|
DeleteIcon,
|
|
115
159
|
SettingsIcon,
|
|
116
|
-
IconButton
|
|
160
|
+
IconButton,
|
|
161
|
+
FormLabel,
|
|
162
|
+
Input
|
|
117
163
|
};
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
buildBlockDropData,
|
|
12
12
|
canDropBlock,
|
|
13
13
|
isBlockDragData
|
|
14
|
-
} from "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
14
|
+
} from "../../chunk-WBDPDGFA.js";
|
|
15
|
+
import "../../chunk-F2LYQPXV.js";
|
|
16
|
+
import "../../chunk-XIDE4TDF.js";
|
|
17
17
|
import {
|
|
18
18
|
AddIcon,
|
|
19
19
|
IconButton
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-ZKVKNUJC.js";
|
|
21
21
|
import "../../chunk-XBYJQ5RS.js";
|
|
22
22
|
import "../../chunk-4RNF2DRG.js";
|
|
23
23
|
import {
|
|
@@ -7,4 +7,6 @@ export { ResolvedMedia } from "./ResolvedMedia";
|
|
|
7
7
|
export { LinkPopover } from "./LinkPopover";
|
|
8
8
|
export { defineHeadingSection } from "./defineHeadingSection";
|
|
9
9
|
export { MediaBlock } from "../sections/Media/MediaBlock";
|
|
10
|
+
export { LinkField } from "../shared/LinkField";
|
|
11
|
+
export { usePages, PagesContext, type PagesContextValue } from "../shared/PagesContext";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/primitives/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
EditableRichText,
|
|
3
3
|
LinkPopover,
|
|
4
4
|
defineHeadingSection
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-5PVRACZY.js";
|
|
6
6
|
import {
|
|
7
7
|
EditableGrid,
|
|
8
8
|
EditablePlainText,
|
|
@@ -10,13 +10,17 @@ import {
|
|
|
10
10
|
MediaBlock,
|
|
11
11
|
ResolvedMedia,
|
|
12
12
|
useEditableCollection
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import
|
|
13
|
+
} from "../../chunk-WXBHP4JY.js";
|
|
14
|
+
import {
|
|
15
|
+
LinkField,
|
|
16
|
+
PagesContext,
|
|
17
|
+
usePages
|
|
18
|
+
} from "../../chunk-XIDE4TDF.js";
|
|
15
19
|
import {
|
|
16
20
|
DeleteIcon,
|
|
17
21
|
DragHandle,
|
|
18
22
|
IconButton
|
|
19
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-ZKVKNUJC.js";
|
|
20
24
|
import "../../chunk-XBYJQ5RS.js";
|
|
21
25
|
import "../../chunk-72CG6AA2.js";
|
|
22
26
|
import {
|
|
@@ -164,8 +168,11 @@ export {
|
|
|
164
168
|
EditablePlainText,
|
|
165
169
|
EditableRichText,
|
|
166
170
|
ImageDropZone,
|
|
171
|
+
LinkField,
|
|
167
172
|
LinkPopover,
|
|
168
173
|
MediaBlock,
|
|
174
|
+
PagesContext,
|
|
169
175
|
ResolvedMedia,
|
|
170
|
-
defineHeadingSection
|
|
176
|
+
defineHeadingSection,
|
|
177
|
+
usePages
|
|
171
178
|
};
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
ColorItemSchema,
|
|
3
3
|
ColorSpaceSchema,
|
|
4
4
|
brandGuideSectionDefs
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-67ZOQCUD.js";
|
|
6
|
+
import "../../chunk-F2LYQPXV.js";
|
|
7
|
+
import "../../chunk-WXBHP4JY.js";
|
|
8
|
+
import "../../chunk-ZKVKNUJC.js";
|
|
9
9
|
import "../../chunk-XBYJQ5RS.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-3ZRQ4G5F.js";
|
|
11
11
|
import "../../chunk-BS5AQHZG.js";
|
|
12
12
|
import "../../chunk-WDSVHKAH.js";
|
|
13
13
|
import "../../chunk-4RNF2DRG.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-LQHYVPBS.js";
|
|
4
|
+
import "../../chunk-67ZOQCUD.js";
|
|
5
|
+
import "../../chunk-WBDPDGFA.js";
|
|
6
|
+
import "../../chunk-F2LYQPXV.js";
|
|
7
|
+
import "../../chunk-5PVRACZY.js";
|
|
8
|
+
import "../../chunk-WXBHP4JY.js";
|
|
9
|
+
import "../../chunk-XIDE4TDF.js";
|
|
10
|
+
import "../../chunk-ZKVKNUJC.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
12
12
|
import "../../chunk-XBYJQ5RS.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-3ZRQ4G5F.js";
|
|
14
14
|
import "../../chunk-BS5AQHZG.js";
|
|
15
15
|
import "../../chunk-WDSVHKAH.js";
|
|
16
16
|
import "../../chunk-4RNF2DRG.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allSectionDefs
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-LQHYVPBS.js";
|
|
4
|
+
import "../../chunk-67ZOQCUD.js";
|
|
5
|
+
import "../../chunk-WBDPDGFA.js";
|
|
6
|
+
import "../../chunk-F2LYQPXV.js";
|
|
7
|
+
import "../../chunk-5PVRACZY.js";
|
|
8
|
+
import "../../chunk-WXBHP4JY.js";
|
|
9
|
+
import "../../chunk-XIDE4TDF.js";
|
|
10
|
+
import "../../chunk-ZKVKNUJC.js";
|
|
11
11
|
import "../../chunk-Y4JQGO6G.js";
|
|
12
12
|
import "../../chunk-XBYJQ5RS.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-3ZRQ4G5F.js";
|
|
14
14
|
import "../../chunk-BS5AQHZG.js";
|
|
15
15
|
import "../../chunk-WDSVHKAH.js";
|
|
16
16
|
import "../../chunk-4RNF2DRG.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorShell.d.ts","sourceRoot":"","sources":["../../../src/components/shell/EditorShell.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ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YAAY,CAAC,EACvC,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,eAAe,EAAE,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK/B"}
|
|
@@ -52,6 +52,8 @@ interface PublishDeps {
|
|
|
52
52
|
sections: LoadedSection[];
|
|
53
53
|
index: SiteIndex;
|
|
54
54
|
savedIds: string[];
|
|
55
|
+
mediaManifest: MediaManifest;
|
|
56
|
+
documentManifest: DocumentManifest;
|
|
55
57
|
}) => Promise<void>;
|
|
56
58
|
/** Injected by EditorShell. Receives non-fatal server warnings from a
|
|
57
59
|
* successful save (e.g. the nav.json replacement was declined by the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEditorPublish.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorPublish.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAgDpF,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,OAAO,CAAC;IAC7B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B;;;;;;mFAM+E;IAC/E,SAAS,EAAE,CAA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,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,gBAAqB,EACrB,gBAAqB,EACrB,wBAA6B,EAC7B,oBAAoB,EACpB,kBAAkB,GACnB,EAAE,WAAW;;;;;;;EA+pBb"}
|
package/dist/index.js
CHANGED
package/dist/lib/dexie.d.ts
CHANGED
|
@@ -65,11 +65,24 @@ export declare function getBranchShas(): Promise<{
|
|
|
65
65
|
mainSha: string | null;
|
|
66
66
|
} | null>;
|
|
67
67
|
export declare function getDeletedSections(): Promise<string[]>;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Write the content snapshot for one commit.
|
|
70
|
+
*
|
|
71
|
+
* `manifests` is REQUIRED, and that is the whole point: both sidecars belong to
|
|
72
|
+
* this sha, so every writer that advances the row must restate them. They used to
|
|
73
|
+
* be optional (the media one lived in a separate store entirely), and every
|
|
74
|
+
* save/publish that re-primed this row left them behind at an older sha — a later
|
|
75
|
+
* cache hit then served pre-upload media ("No Image" on images the published site
|
|
76
|
+
* rendered fine) and an empty document manifest ("File missing" on committed
|
|
77
|
+
* documents). Passing them positionally makes forgetting a compile error.
|
|
78
|
+
*/
|
|
79
|
+
export declare function cacheContent(sha: string, sections: LoadedSection[], index: SiteIndex, siteConfig: Record<string, unknown>, manifests: {
|
|
80
|
+
media: MediaManifest;
|
|
81
|
+
documents: DocumentManifest;
|
|
82
|
+
}, diff?: {
|
|
83
|
+
savedBranchSha?: string | null;
|
|
84
|
+
changedSectionIds?: string[];
|
|
85
|
+
mainIndex?: SiteIndex | null;
|
|
73
86
|
}): Promise<void>;
|
|
74
87
|
export declare function getCachedContent(): Promise<{
|
|
75
88
|
sha: string;
|
|
@@ -79,14 +92,18 @@ export declare function getCachedContent(): Promise<{
|
|
|
79
92
|
savedBranchSha: string | null;
|
|
80
93
|
changedSectionIds: string[];
|
|
81
94
|
mainIndex: SiteIndex | null;
|
|
82
|
-
|
|
95
|
+
/** Both are null ONLY for a row written before the sidecars moved onto it.
|
|
96
|
+
* Callers must treat null as an unusable cache and re-fetch — substituting an
|
|
97
|
+
* empty manifest would blank every image ("No Image") or every committed
|
|
98
|
+
* document ("File missing") on the page. An EMPTY manifest is a legitimate
|
|
99
|
+
* value and is not null. */
|
|
100
|
+
mediaManifest: MediaManifest | null;
|
|
101
|
+
documentManifest: DocumentManifest | null;
|
|
83
102
|
} | null>;
|
|
84
103
|
/** Invalidate only the cached content snapshot (e.g. after a publish removes the
|
|
85
104
|
* draft), forcing the next editor load to refetch rather than serve stale diff
|
|
86
105
|
* state. Narrower than discardSavedChanges, which also clears index/meta/config. */
|
|
87
106
|
export declare function clearContentCache(): Promise<void>;
|
|
88
|
-
export declare function persistMediaManifest(manifest: MediaManifest): Promise<void>;
|
|
89
|
-
export declare function getMediaManifest(): Promise<MediaManifest | null>;
|
|
90
107
|
export declare function addPendingMediaItem(item: MediaItem, localUrls?: Record<string, string>, blobs?: Record<string, Blob>): Promise<void>;
|
|
91
108
|
export declare function getPendingMediaItems(): Promise<MediaItem[]>;
|
|
92
109
|
export declare function getPendingMediaLocalUrls(id: string): Promise<Record<string, string> | null>;
|
package/dist/lib/dexie.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dexie.d.ts","sourceRoot":"","sources":["../../src/lib/dexie.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAe,UAAU,EAA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,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAEtE;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnE;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,qBAAqB,CAAC;IAC7B,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAErF;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAG5E;AAED,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAG7E;AAED,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG7E"}
|
package/dist/lib/dexie.js
CHANGED
|
@@ -8,7 +8,6 @@ var EditorDatabase = class extends Dexie {
|
|
|
8
8
|
meta;
|
|
9
9
|
siteConfig;
|
|
10
10
|
contentCache;
|
|
11
|
-
mediaManifest;
|
|
12
11
|
pendingMedia;
|
|
13
12
|
pendingMediaDeletions;
|
|
14
13
|
preservedEdits;
|
|
@@ -114,6 +113,20 @@ var EditorDatabase = class extends Dexie {
|
|
|
114
113
|
preservedEdits: "id, sectionId",
|
|
115
114
|
pendingDocuments: "id"
|
|
116
115
|
});
|
|
116
|
+
this.version(11).stores({
|
|
117
|
+
sections: "sectionId",
|
|
118
|
+
siteIndex: "key",
|
|
119
|
+
meta: "key",
|
|
120
|
+
siteConfig: "key",
|
|
121
|
+
contentCache: "key",
|
|
122
|
+
mediaManifest: null,
|
|
123
|
+
pendingMedia: "id",
|
|
124
|
+
pendingMediaDeletions: "id",
|
|
125
|
+
preservedEdits: "id, sectionId",
|
|
126
|
+
pendingDocuments: "id"
|
|
127
|
+
}).upgrade(async (tx) => {
|
|
128
|
+
await tx.table("contentCache").clear();
|
|
129
|
+
});
|
|
117
130
|
}
|
|
118
131
|
};
|
|
119
132
|
var db = null;
|
|
@@ -310,7 +323,7 @@ async function getDeletedSections() {
|
|
|
310
323
|
const row = await getDb().siteIndex.get("current");
|
|
311
324
|
return row?.deletedSections ?? [];
|
|
312
325
|
}
|
|
313
|
-
async function cacheContent(sha, sections, index, siteConfig, diff) {
|
|
326
|
+
async function cacheContent(sha, sections, index, siteConfig, manifests, diff) {
|
|
314
327
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
315
328
|
await getDb().contentCache.put({
|
|
316
329
|
key: "current",
|
|
@@ -322,7 +335,8 @@ async function cacheContent(sha, sections, index, siteConfig, diff) {
|
|
|
322
335
|
savedBranchSha: diff?.savedBranchSha ?? null,
|
|
323
336
|
changedSectionIds: diff?.changedSectionIds ?? [],
|
|
324
337
|
mainIndex: diff?.mainIndex ?? null,
|
|
325
|
-
|
|
338
|
+
mediaManifest: manifests.media,
|
|
339
|
+
documentManifest: manifests.documents
|
|
326
340
|
});
|
|
327
341
|
}
|
|
328
342
|
async function getCachedContent() {
|
|
@@ -338,23 +352,13 @@ async function getCachedContent() {
|
|
|
338
352
|
// No stored mainIndex (e.g. legacy or post-publish cache) means "no draft",
|
|
339
353
|
// so the published index equals the current index.
|
|
340
354
|
mainIndex: row.mainIndex ?? row.index,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
// heals on the next fresh load or save.
|
|
344
|
-
documentManifest: row.documentManifest ?? {}
|
|
355
|
+
mediaManifest: row.mediaManifest ?? null,
|
|
356
|
+
documentManifest: row.documentManifest ?? null
|
|
345
357
|
};
|
|
346
358
|
}
|
|
347
359
|
async function clearContentCache() {
|
|
348
360
|
await getDb().contentCache.clear();
|
|
349
361
|
}
|
|
350
|
-
async function persistMediaManifest(manifest) {
|
|
351
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
352
|
-
await getDb().mediaManifest.put({ key: "current", manifest, updatedAt: now });
|
|
353
|
-
}
|
|
354
|
-
async function getMediaManifest() {
|
|
355
|
-
const row = await getDb().mediaManifest.get("current");
|
|
356
|
-
return row?.manifest ?? null;
|
|
357
|
-
}
|
|
358
362
|
async function addPendingMediaItem(item, localUrls = {}, blobs = {}) {
|
|
359
363
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
360
364
|
await getDb().pendingMedia.put({ id: item.id, item, localUrls, blobs, updatedAt: now });
|
|
@@ -444,7 +448,6 @@ export {
|
|
|
444
448
|
getDeletedSections,
|
|
445
449
|
getDirtySectionRows,
|
|
446
450
|
getDirtySections,
|
|
447
|
-
getMediaManifest,
|
|
448
451
|
getPendingDocumentBlob,
|
|
449
452
|
getPendingDocuments,
|
|
450
453
|
getPendingMediaBlobs,
|
|
@@ -456,7 +459,6 @@ export {
|
|
|
456
459
|
listPreservedEdits,
|
|
457
460
|
markPendingMediaDeleted,
|
|
458
461
|
persistAll,
|
|
459
|
-
persistMediaManifest,
|
|
460
462
|
persistSiteConfig,
|
|
461
463
|
persistSiteIndex,
|
|
462
464
|
preserveEdit,
|
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/schemas/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;EAA8B,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhD;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;2BAmB1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/schemas/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;EAA8B,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUhD;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;2BAmB1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAKxD,eAAO,MAAM,YAAY,EAAE,SAAoF,CAAC"}
|
package/dist/schemas/link.js
CHANGED
package/package.json
CHANGED
|
@@ -9,3 +9,8 @@ export { ResolvedMedia } from "./ResolvedMedia";
|
|
|
9
9
|
export { LinkPopover } from "./LinkPopover";
|
|
10
10
|
export { defineHeadingSection } from "./defineHeadingSection";
|
|
11
11
|
export { MediaBlock } from "../sections/Media/MediaBlock";
|
|
12
|
+
// Link selector (external URL / internal page + section) plus the pages context
|
|
13
|
+
// that feeds its dropdowns, so custom sections can reuse the same link picker the
|
|
14
|
+
// Button/Media sections use and derive labels from the live page/heading list.
|
|
15
|
+
export { LinkField } from "../shared/LinkField";
|
|
16
|
+
export { usePages, PagesContext, type PagesContextValue } from "../shared/PagesContext";
|