alinea 1.2.0 → 1.2.2

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.
@@ -29,17 +29,39 @@ var NextCMS = class extends CMS {
29
29
  });
30
30
  super(rawConfig, async () => {
31
31
  const context = await requestContext(this.config);
32
- const client = new Client({
33
- config: this.config,
34
- url: context.handlerUrl.href,
35
- applyAuth(init2) {
32
+ const createClient = (applyAuth) => {
33
+ return new Client({
34
+ config: this.config,
35
+ url: context.handlerUrl.href,
36
+ applyAuth
37
+ });
38
+ };
39
+ const apiClient = createClient((init2) => {
40
+ const headers = new Headers(init2?.headers);
41
+ headers.set("Authorization", `Bearer ${context.apiKey}`);
42
+ return { ...init2, headers };
43
+ });
44
+ const clientResolve = apiClient.resolve.bind(apiClient);
45
+ const clientForUser = async () => {
46
+ const { cookies } = await import("next/headers");
47
+ const cookie = await cookies();
48
+ return createClient((init2) => {
36
49
  const headers = new Headers(init2?.headers);
37
- headers.set("Authorization", `Bearer ${context.apiKey}`);
50
+ const alinea = cookie.getAll().filter(({ name }) => name.startsWith("alinea"));
51
+ for (const { name, value } of alinea)
52
+ headers.append("cookie", `${name}=${value}`);
38
53
  return { ...init2, headers };
39
- }
40
- });
41
- const clientResolve = client.resolve.bind(client);
42
- return assign(client, {
54
+ });
55
+ };
56
+ return assign(apiClient, {
57
+ async user() {
58
+ const client = await clientForUser();
59
+ return client.user();
60
+ },
61
+ async mutate(mutations) {
62
+ const client = await clientForUser();
63
+ return client.mutate(mutations);
64
+ },
43
65
  async resolve(params) {
44
66
  const isDev = Boolean(devUrl());
45
67
  let preview;
@@ -58,13 +80,13 @@ var NextCMS = class extends CMS {
58
80
  const { PHASE_PRODUCTION_BUILD } = await import("next/constants");
59
81
  const isBuild = process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD;
60
82
  const { db, previews } = await init;
61
- const sync = () => db.syncWith(client);
83
+ const sync = () => db.syncWith(apiClient);
62
84
  if (!isBuild) {
63
85
  if (preview) {
64
86
  preview = await previews.parse(
65
87
  preview,
66
88
  sync,
67
- client.getDraft.bind(client)
89
+ apiClient.getDraft.bind(apiClient)
68
90
  );
69
91
  } else {
70
92
  const syncInterval = params.syncInterval ?? 60;
@@ -82,20 +104,7 @@ var NextCMS = class extends CMS {
82
104
  this.baseUrl = baseUrl;
83
105
  }
84
106
  async user() {
85
- const { cookies } = await import("next/headers");
86
- const context = await requestContext(this.config);
87
- const cookie = await cookies();
88
- const client = new Client({
89
- config: this.config,
90
- url: context.handlerUrl.href,
91
- applyAuth: (init) => {
92
- const headers = new Headers(init?.headers);
93
- const alinea = cookie.getAll().filter(({ name }) => name.startsWith("alinea"));
94
- for (const { name, value } of alinea)
95
- headers.append("cookie", `${name}=${value}`);
96
- return { ...init, headers };
97
- }
98
- });
107
+ const client = await this.connect();
99
108
  return client.user();
100
109
  }
101
110
  previews = async ({ widget, workspace, root }) => {
@@ -324,10 +324,10 @@ var EntryResolver = class {
324
324
  });
325
325
  }
326
326
  conditionLocale(Table, locale) {
327
- if (!locale)
328
- return sql.value(true);
329
327
  if (locale === null)
330
328
  return isNull(Table.locale);
329
+ if (!locale)
330
+ return sql.value(true);
331
331
  return eq(Table.locale, locale);
332
332
  }
333
333
  conditionStatus(Table, status) {
@@ -2,7 +2,7 @@
2
2
  var package_default = {
3
3
  bin: "./dist/cli.js",
4
4
  name: "alinea",
5
- version: "1.2.0",
5
+ version: "1.2.2",
6
6
  description: "Headless git-based CMS",
7
7
  repository: {
8
8
  type: "git",
package/dist/cli/Serve.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-76ZJ7RWJ.js";
3
+ } from "../chunks/chunk-VF6VY6LR.js";
4
4
  import "../chunks/chunk-U5RRZUYZ.js";
5
5
 
6
6
  // src/cli/Serve.ts
package/dist/cli/bin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-76ZJ7RWJ.js";
3
+ } from "../chunks/chunk-VF6VY6LR.js";
4
4
  import "../chunks/chunk-U5RRZUYZ.js";
5
5
 
6
6
  // node_modules/mri/lib/index.mjs
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../chunks/chunk-76ZJ7RWJ.js";
3
+ } from "../chunks/chunk-VF6VY6LR.js";
4
4
  import {
5
5
  PLazy
6
6
  } from "../chunks/chunk-IKINPSS5.js";
@@ -82,7 +82,7 @@ function CloudAuthView({ setSession }) {
82
82
  /* @__PURE__ */ jsx(
83
83
  Typo.Link,
84
84
  {
85
- href: "https://alinea.sh/docs/deploy/intro",
85
+ href: "https://alinea.sh/docs/deploy",
86
86
  target: "_blank",
87
87
  children: /* @__PURE__ */ jsx("span", { children: "fully configure a custom backend" })
88
88
  }
@@ -7,6 +7,7 @@ import { HasType } from './Internal.js';
7
7
  import { Label } from './Label.js';
8
8
  import { SummaryProps } from './media/Summary.js';
9
9
  import { OrderBy } from './OrderBy.js';
10
+ import { Preview } from './Preview.js';
10
11
  import { Section } from './Section.js';
11
12
  import { RecordShape } from './shape/RecordShape.js';
12
13
  import { Expand } from './util/Types.js';
@@ -35,6 +36,7 @@ export declare namespace Type {
35
36
  function isType(type: any): type is Type;
36
37
  function sharedData(type: Type, entryData: Record<string, unknown>): Record<string, unknown> | undefined;
37
38
  function initialValue(type: Type): Record<string, unknown>;
39
+ function preview(type: Type): Preview | undefined;
38
40
  function validate(type: Type): void;
39
41
  function referencedViews(type: Type): Array<string>;
40
42
  }
@@ -62,6 +64,7 @@ export interface TypeConfig<Definition> {
62
64
  /** The position where new children will be inserted */
63
65
  insertOrder?: 'first' | 'last' | 'free';
64
66
  entryUrl?: (meta: EntryUrlMeta) => string;
67
+ preview?: Preview;
65
68
  }
66
69
  export interface TypeInternal extends TypeConfig<FieldsDefinition> {
67
70
  label: string;
package/dist/core/Type.js CHANGED
@@ -75,6 +75,10 @@ var Type;
75
75
  return res;
76
76
  }
77
77
  Type2.initialValue = initialValue;
78
+ function preview(type2) {
79
+ return getType(type2).preview;
80
+ }
81
+ Type2.preview = preview;
78
82
  const TypeOptions = object({
79
83
  view: string.optional,
80
84
  summaryRow: string.optional,
@@ -14,11 +14,16 @@ export interface EntryTreeItem {
14
14
  workspace: string;
15
15
  root: string;
16
16
  path: string;
17
- parentPaths: Array<string>;
17
+ parents: Array<{
18
+ path: string;
19
+ type: string;
20
+ }>;
18
21
  }>;
19
22
  isFolder?: boolean;
23
+ canDrag?: boolean;
20
24
  children: Array<string>;
21
25
  }
22
26
  export declare function useEntryTreeProvider(): AsyncTreeDataLoader<EntryTreeItem> & {
27
+ canDrag(item: Array<ItemInstance<EntryTreeItem>>): boolean;
23
28
  onDrop(items: Array<ItemInstance<EntryTreeItem>>, target: DropTarget<EntryTreeItem>): void;
24
29
  };
@@ -23,6 +23,7 @@ import {
23
23
  generateNKeysBetween
24
24
  } from "alinea/core/util/FractionalIndexing";
25
25
  import { entries } from "alinea/core/util/Objects";
26
+ import { parents } from "alinea/query";
26
27
  import { useMemo } from "react";
27
28
  import { useDashboard } from "../hook/UseDashboard.js";
28
29
  import { configAtom } from "./DashboardAtoms.js";
@@ -82,10 +83,12 @@ var entryTreeItemLoaderAtom = atom(async (get) => {
82
83
  workspace: Entry.workspace,
83
84
  root: Entry.root,
84
85
  path: Entry.path,
85
- parentPaths: {
86
- edge: "parents",
87
- select: Entry.path
88
- }
86
+ parents: parents({
87
+ select: {
88
+ path: Entry.path,
89
+ type: Entry.type
90
+ }
91
+ })
89
92
  };
90
93
  const rows = await graph.find({
91
94
  groupBy: Entry.id,
@@ -103,6 +106,7 @@ var entryTreeItemLoaderAtom = atom(async (get) => {
103
106
  status: "preferDraft"
104
107
  });
105
108
  for (const row of rows) {
109
+ const canDrag = row.data.parents.length > 0 ? !getType(schema[row.data.parents.at(-1).type]).orderChildrenBy : true;
106
110
  const type = schema[row.type];
107
111
  const orderBy = getType(type).orderChildrenBy ?? {
108
112
  asc: Entry.index,
@@ -139,6 +143,7 @@ var entryTreeItemLoaderAtom = atom(async (get) => {
139
143
  type: row.type,
140
144
  index: row.index,
141
145
  entries: entries2,
146
+ canDrag,
142
147
  children: [...new Set(orderedChildren.map((child) => child.id))]
143
148
  });
144
149
  }
@@ -178,6 +183,12 @@ function useEntryTreeProvider() {
178
183
  const { config } = useDashboard();
179
184
  return useMemo(() => {
180
185
  return {
186
+ canDrag(items) {
187
+ return items.every((item) => {
188
+ const data = item.getItemData();
189
+ return data.canDrag;
190
+ });
191
+ },
181
192
  onDrop(items, { item: parent, childIndex, insertionIndex }) {
182
193
  if (items.length !== 1)
183
194
  return;
@@ -213,7 +224,11 @@ function useEntryTreeProvider() {
213
224
  mutations.push({
214
225
  type: MutationType.Order,
215
226
  entryId: entry.id,
216
- file: entryFileName(config, entry, entry.parentPaths),
227
+ file: entryFileName(
228
+ config,
229
+ entry,
230
+ entry.parents.map((p) => p.path)
231
+ ),
217
232
  index: correctedIndexKey
218
233
  });
219
234
  }
@@ -223,7 +238,11 @@ function useEntryTreeProvider() {
223
238
  mutations.push({
224
239
  type: MutationType.Order,
225
240
  entryId: entry.id,
226
- file: entryFileName(config, entry, entry.parentPaths),
241
+ file: entryFileName(
242
+ config,
243
+ entry,
244
+ entry.parents.map((p) => p.path)
245
+ ),
227
246
  index: newIndexKey
228
247
  });
229
248
  }
@@ -668,7 +668,7 @@ function createEntryEditor(entryData) {
668
668
  });
669
669
  const discardEdits = edits.resetChanges;
670
670
  const isLoading = edits.isLoading;
671
- const preview = Root.preview(
671
+ const preview = Type.preview(type) ?? Root.preview(
672
672
  config.workspaces[activeVersion.workspace][activeVersion.root]
673
673
  ) ?? Workspace.preview(config.workspaces[activeVersion.workspace]) ?? config.preview;
674
674
  const previewToken = atom(async (get) => {
@@ -31,7 +31,7 @@ var FormAtoms = class {
31
31
  this.path = path;
32
32
  this.options = options;
33
33
  const readOnly = options.readOnly;
34
- const forcedOptions = typeof readOnly === "boolean" ? { readOnly } : {};
34
+ const forcedOptions = readOnly === true ? { readOnly } : {};
35
35
  container.doc.transact(() => {
36
36
  for (const section of Type.sections(type)) {
37
37
  for (const [key, field] of entries(Section.fields(section))) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  package_default
3
- } from "../../chunks/chunk-76ZJ7RWJ.js";
3
+ } from "../../chunks/chunk-VF6VY6LR.js";
4
4
  import {
5
5
  create as create2
6
6
  } from "../../chunks/chunk-IOTY7UTU.js";
@@ -1005,6 +1005,7 @@ function EntryTree({ id, selected = [] }) {
1005
1005
  const tree = useTree({
1006
1006
  rootItemId: rootId(root.name),
1007
1007
  canDropInbetween: true,
1008
+ canDrag: (items) => treeProvider.canDrag(items),
1008
1009
  onDrop(items, target) {
1009
1010
  return treeProvider.onDrop(items, target);
1010
1011
  },
@@ -21,17 +21,19 @@ import { DropdownMenu } from "alinea/ui/DropdownMenu";
21
21
  import { IcOutlineAvTimer } from "alinea/ui/icons/IcOutlineAvTimer";
22
22
  import { IcOutlineDrafts } from "alinea/ui/icons/IcOutlineDrafts";
23
23
  import { IcOutlineKeyboardTab } from "alinea/ui/icons/IcOutlineKeyboardTab";
24
- import { IcOutlineRemoveRedEye } from "alinea/ui/icons/IcOutlineRemoveRedEye";
25
24
  import { IcRoundArchive } from "alinea/ui/icons/IcRoundArchive";
26
25
  import { IcRoundCheck } from "alinea/ui/icons/IcRoundCheck";
27
26
  import { IcRoundDelete } from "alinea/ui/icons/IcRoundDelete";
28
27
  import { IcRoundEdit } from "alinea/ui/icons/IcRoundEdit";
28
+ import { IcRoundHistory } from "alinea/ui/icons/IcRoundHistory";
29
29
  import { IcRoundMenu } from "alinea/ui/icons/IcRoundMenu";
30
30
  import { IcRoundMoreVert } from "alinea/ui/icons/IcRoundMoreVert";
31
31
  import { IcRoundPublishedWithChanges } from "alinea/ui/icons/IcRoundPublishedWithChanges";
32
32
  import { IcRoundSave } from "alinea/ui/icons/IcRoundSave";
33
33
  import { IcRoundTranslate } from "alinea/ui/icons/IcRoundTranslate";
34
34
  import { IcRoundUnfoldMore } from "alinea/ui/icons/IcRoundUnfoldMore";
35
+ import { IcRoundUpdate } from "alinea/ui/icons/IcRoundUpdate";
36
+ import { IcRoundVisibility } from "alinea/ui/icons/IcRoundVisibility";
35
37
  import { useState } from "react";
36
38
  import { EntryTransition } from "../../atoms/EntryEditorAtoms.js";
37
39
  import { useLocation, useNavigate } from "../../atoms/LocationAtoms.js";
@@ -111,7 +113,7 @@ var transitions = {
111
113
  var variantIcon = {
112
114
  draft: IcOutlineDrafts,
113
115
  editing: IcRoundEdit,
114
- published: IcOutlineRemoveRedEye,
116
+ published: IcRoundVisibility,
115
117
  archived: IcRoundArchive,
116
118
  untranslated: IcRoundTranslate,
117
119
  revision: IcRoundPublishedWithChanges,
@@ -193,51 +195,69 @@ function EntryHeader({ editor, editable = true }) {
193
195
  children: "Remove draft"
194
196
  }
195
197
  ) : variant === EntryStatus.Published && !editor.activeVersion.seeded ? isMediaFile ? /* @__PURE__ */ jsxs(Fragment, { children: [
196
- /* @__PURE__ */ jsx(
198
+ /* @__PURE__ */ jsxs(
197
199
  DropdownMenu.Item,
198
200
  {
199
201
  className: styles.root.action(),
200
202
  onClick: replaceFile,
201
- children: "Replace"
203
+ children: [
204
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundUpdate }),
205
+ "Replace"
206
+ ]
202
207
  }
203
208
  ),
204
- /* @__PURE__ */ jsx(
209
+ /* @__PURE__ */ jsxs(
205
210
  DropdownMenu.Item,
206
211
  {
207
212
  className: styles.root.action(),
208
213
  onClick: deleteFileAndNavigate,
209
- children: "Delete"
214
+ children: [
215
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundDelete }),
216
+ "Delete"
217
+ ]
210
218
  }
211
219
  )
212
- ] }) : isMediaLibrary ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
220
+ ] }) : isMediaLibrary ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
213
221
  DropdownMenu.Item,
214
222
  {
215
223
  className: styles.root.action(),
216
224
  onClick: deleteMediaLibraryAndNavigate,
217
- children: "Delete"
225
+ children: [
226
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundDelete }),
227
+ "Delete"
228
+ ]
218
229
  }
219
- ) }) : /* @__PURE__ */ jsx(
230
+ ) }) : /* @__PURE__ */ jsxs(
220
231
  DropdownMenu.Item,
221
232
  {
222
233
  className: styles.root.action(),
223
234
  onClick: archivePublished,
224
- children: "Archive"
235
+ children: [
236
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundArchive }),
237
+ "Archive"
238
+ ]
225
239
  }
226
240
  ) : variant === EntryStatus.Archived ? /* @__PURE__ */ jsxs(Fragment, { children: [
227
- canPublish && /* @__PURE__ */ jsx(
241
+ canPublish && /* @__PURE__ */ jsxs(
228
242
  DropdownMenu.Item,
229
243
  {
230
244
  className: styles.root.action(),
231
245
  onClick: publishArchived,
232
- children: "Publish"
246
+ children: [
247
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundVisibility }),
248
+ "Publish"
249
+ ]
233
250
  }
234
251
  ),
235
- /* @__PURE__ */ jsx(
252
+ /* @__PURE__ */ jsxs(
236
253
  DropdownMenu.Item,
237
254
  {
238
255
  className: styles.root.action(),
239
256
  onClick: deleteArchived,
240
- children: "Delete"
257
+ children: [
258
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundDelete }),
259
+ "Delete"
260
+ ]
241
261
  }
242
262
  )
243
263
  ] }) : null;
@@ -333,13 +353,21 @@ function EntryHeader({ editor, editable = true }) {
333
353
  !untranslated && !hasChanges && selectedStatus === "draft" && /* @__PURE__ */ jsx(Button, { icon: IcRoundCheck, onClick: publishDraft, children: "Publish draft" }),
334
354
  variant === "revision" && /* @__PURE__ */ jsx(Button, { icon: IcRoundSave, onClick: restoreRevision, children: "Restore" }),
335
355
  /* @__PURE__ */ jsxs(DropdownMenu.Root, { bottom: true, left: true, children: [
336
- /* @__PURE__ */ jsx(DropdownMenu.Trigger, { className: styles.root.more(variant), children: /* @__PURE__ */ jsx(Icon, { icon: IcRoundMoreVert }) }),
356
+ /* @__PURE__ */ jsx(
357
+ DropdownMenu.Trigger,
358
+ {
359
+ className: styles.root.more(variant),
360
+ title: isMediaFile || isMediaLibrary ? "Media actions" : "Entry actions",
361
+ children: /* @__PURE__ */ jsx(Icon, { icon: IcRoundMoreVert })
362
+ }
363
+ ),
337
364
  /* @__PURE__ */ jsxs(DropdownMenu.Items, { children: [
338
365
  !isMediaFile && !isMediaLibrary && /* @__PURE__ */ jsxs(
339
366
  DropdownMenu.Item,
340
367
  {
341
368
  onClick: () => setShowHistory(!showHistory),
342
369
  children: [
370
+ /* @__PURE__ */ jsx(Icon, { icon: IcRoundHistory }),
343
371
  showHistory ? "Hide" : "Show",
344
372
  " history"
345
373
  ]
@@ -11,8 +11,8 @@ import "../../../chunks/chunk-U5RRZUYZ.js";
11
11
  // src/dashboard/view/entry/EntryHistory.tsx
12
12
  import { HStack, Icon, Loader, VStack } from "alinea/ui";
13
13
  import { Ellipsis } from "alinea/ui/Ellipsis";
14
- import { IcOutlineRemoveRedEye } from "alinea/ui/icons/IcOutlineRemoveRedEye";
15
14
  import { IcRoundPublishedWithChanges } from "alinea/ui/icons/IcRoundPublishedWithChanges";
15
+ import { IcRoundVisibility } from "alinea/ui/icons/IcRoundVisibility";
16
16
  import { Suspense } from "react";
17
17
 
18
18
  // src/dashboard/view/entry/EntryHistory.module.scss
@@ -58,7 +58,7 @@ function RevisionItem({ editor, revision, isCurrent }) {
58
58
  }),
59
59
  onClick: () => setPreviewRevision(isCurrent ? void 0 : revision),
60
60
  children: /* @__PURE__ */ jsxs(HStack, { center: true, gap: 10, children: [
61
- isCurrent ? /* @__PURE__ */ jsx(Icon, { icon: IcOutlineRemoveRedEye, size: 18 }) : /* @__PURE__ */ jsx(Icon, { icon: IcRoundPublishedWithChanges, size: 18 }),
61
+ isCurrent ? /* @__PURE__ */ jsx(Icon, { icon: IcRoundVisibility, size: 18 }) : /* @__PURE__ */ jsx(Icon, { icon: IcRoundPublishedWithChanges, size: 18 }),
62
62
  /* @__PURE__ */ jsxs(VStack, { align: "flex-start", children: [
63
63
  /* @__PURE__ */ jsx("b", { children: date.toLocaleDateString(void 0, {
64
64
  year: "numeric",
@@ -168,7 +168,8 @@ function ListInputRow({
168
168
  {
169
169
  icon: getType(type).icon || IcRoundDragHandle,
170
170
  ...handle,
171
- style: { cursor: handle ? "grab" : "grabbing" }
171
+ style: { cursor: handle ? "grab" : "grabbing" },
172
+ title: "Drag and drop to reorder"
172
173
  }
173
174
  ) }),
174
175
  /* @__PURE__ */ jsx(Sink.Title, { children: /* @__PURE__ */ jsx(TextLabel, { label: Type.label(type) }) }),
@@ -179,7 +180,8 @@ function ListInputRow({
179
180
  icon: IcBaselineContentCopy,
180
181
  onClick: () => {
181
182
  onCopyBlock();
182
- }
183
+ },
184
+ title: "Copy block"
183
185
  }
184
186
  ),
185
187
  !readOnly && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -187,17 +189,26 @@ function ListInputRow({
187
189
  IconButton,
188
190
  {
189
191
  icon: IcRoundKeyboardArrowUp,
190
- onClick: () => onMove?.(-1)
192
+ onClick: () => onMove?.(-1),
193
+ title: "Move up"
191
194
  }
192
195
  ),
193
196
  /* @__PURE__ */ jsx(
194
197
  IconButton,
195
198
  {
196
199
  icon: IcRoundKeyboardArrowDown,
197
- onClick: () => onMove?.(1)
200
+ onClick: () => onMove?.(1),
201
+ title: "Move down"
198
202
  }
199
203
  ),
200
- /* @__PURE__ */ jsx(IconButton, { icon: IcRoundClose, onClick: onDelete })
204
+ /* @__PURE__ */ jsx(
205
+ IconButton,
206
+ {
207
+ icon: IcRoundClose,
208
+ onClick: onDelete,
209
+ title: "Delete block"
210
+ }
211
+ )
201
212
  ] })
202
213
  ] })
203
214
  ] }),
@@ -120,6 +120,7 @@ function PathInput({ field }) {
120
120
  onBlur: () => {
121
121
  setFocus(false);
122
122
  applySuffix();
123
+ setEndsWithSeparator(false);
123
124
  },
124
125
  style: { paddingRight: px(getRightInputPadding()) },
125
126
  readOnly: options.readOnly
package/dist/index.css CHANGED
@@ -1150,6 +1150,7 @@ button {
1150
1150
 
1151
1151
  /* src/dashboard/view/IconButton.module.scss */
1152
1152
  .alinea-IconButton {
1153
+ cursor: pointer;
1153
1154
  display: flex;
1154
1155
  align-items: center;
1155
1156
  justify-content: center;
@@ -1184,14 +1185,28 @@ button {
1184
1185
  display: inline-block;
1185
1186
  vertical-align: top;
1186
1187
  }
1187
- @media (max-width: 1024px) {
1188
- .alinea-InputLabel:not([style*="width: 100%"]) {
1189
- width: 50% !important;
1188
+ @supports not (contain: inline-size) {
1189
+ @media (max-width: 1024px) {
1190
+ .alinea-InputLabel:not([style*="width: 100%"]) {
1191
+ width: 50% !important;
1192
+ }
1193
+ }
1194
+ @media (max-width: 768px) {
1195
+ .alinea-InputLabel:not([style*="width: 100%"]) {
1196
+ width: 100% !important;
1197
+ }
1190
1198
  }
1191
1199
  }
1192
- @media (max-width: 768px) {
1193
- .alinea-InputLabel:not([style*="width: 100%"]) {
1194
- width: 100% !important;
1200
+ @supports (contain: inline-size) {
1201
+ @container lift (max-width: 480px) {
1202
+ .alinea-InputLabel:not([style*="width: 100%"]) {
1203
+ width: 50% !important;
1204
+ }
1205
+ }
1206
+ @container lift (max-width: 320px) {
1207
+ .alinea-InputLabel:not([style*="width: 100%"]) {
1208
+ width: 100% !important;
1209
+ }
1195
1210
  }
1196
1211
  }
1197
1212
  .alinea-InputLabel-inner {
@@ -3687,6 +3702,7 @@ h3.alinea-RichTextKit-heading:not(:last-child) {
3687
3702
  .alinea-DropdownMenu-item {
3688
3703
  width: 100%;
3689
3704
  font-size: 0.875rem;
3705
+ gap: 0.5rem;
3690
3706
  display: flex;
3691
3707
  align-items: center;
3692
3708
  min-height: 1.5625rem;
@@ -3752,6 +3768,12 @@ h3.alinea-RichTextKit-heading:not(:last-child) {
3752
3768
  padding: 0.375rem 0.625rem 0.625rem 0.625rem;
3753
3769
  }
3754
3770
  }
3771
+ @supports (contain: inline-size) {
3772
+ .alinea-Lift {
3773
+ container-name: lift;
3774
+ container-type: inline-size;
3775
+ }
3776
+ }
3755
3777
  .alinea-Lift:empty {
3756
3778
  display: none;
3757
3779
  }
@@ -35,6 +35,7 @@ function registerPreviewWidget() {
35
35
  position: fixed;
36
36
  bottom: 15px;
37
37
  left: 50%;
38
+ transform: translateX(-50%);
38
39
  z-index: 9999;
39
40
  }
40
41
  .inner {
@@ -47,7 +48,6 @@ function registerPreviewWidget() {
47
48
  height: 35px;
48
49
  font-size: 14px;
49
50
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
50
- transform: translateX(-50%);
51
51
  border: 1.5px solid #E4E4E7;
52
52
  transition: border 0.2s ease-out;
53
53
  animation: fade-in 0.3s ease-out;
@@ -0,0 +1,2 @@
1
+ import type { SVGProps } from 'react';
2
+ export declare function IcRoundHistory(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import "../../chunks/chunk-U5RRZUYZ.js";
2
+
3
+ // src/ui/icons/IcRoundHistory.tsx
4
+ import { jsx } from "react/jsx-runtime";
5
+ function IcRoundHistory(props) {
6
+ return /* @__PURE__ */ jsx(
7
+ "svg",
8
+ {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ width: "1em",
11
+ height: "1em",
12
+ viewBox: "0 0 24 24",
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx(
15
+ "path",
16
+ {
17
+ fill: "currentColor",
18
+ d: "M13.26 3C8.17 2.86 4 6.95 4 12H2.21c-.45 0-.67.54-.35.85l2.79 2.8c.2.2.51.2.71 0l2.79-2.8a.5.5 0 0 0-.36-.85H6c0-3.9 3.18-7.05 7.1-7c3.72.05 6.85 3.18 6.9 6.9c.05 3.91-3.1 7.1-7 7.1c-1.61 0-3.1-.55-4.28-1.48a.994.994 0 0 0-1.32.08c-.42.42-.39 1.13.08 1.49A8.86 8.86 0 0 0 13 21c5.05 0 9.14-4.17 9-9.26c-.13-4.69-4.05-8.61-8.74-8.74m-.51 5c-.41 0-.75.34-.75.75v3.68c0 .35.19.68.49.86l3.12 1.85c.36.21.82.09 1.03-.26c.21-.36.09-.82-.26-1.03l-2.88-1.71v-3.4c0-.4-.34-.74-.75-.74"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ }
24
+ export {
25
+ IcRoundHistory
26
+ };
@@ -0,0 +1,2 @@
1
+ import { SVGProps } from 'react';
2
+ export declare function IcRoundUpdate(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import "../../chunks/chunk-U5RRZUYZ.js";
2
+
3
+ // src/ui/icons/IcRoundUpdate.tsx
4
+ import { jsx } from "react/jsx-runtime";
5
+ function IcRoundUpdate(props) {
6
+ return /* @__PURE__ */ jsx(
7
+ "svg",
8
+ {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ width: "1em",
11
+ height: "1em",
12
+ viewBox: "0 0 24 24",
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx(
15
+ "path",
16
+ {
17
+ fill: "currentColor",
18
+ d: "M11 8.75v3.68c0 .35.19.68.49.86l3.12 1.85c.36.21.82.09 1.03-.26c.21-.36.1-.82-.26-1.03l-2.87-1.71v-3.4c-.01-.4-.35-.74-.76-.74s-.75.34-.75.75m10 .75V4.21c0-.45-.54-.67-.85-.35l-1.78 1.78a9.01 9.01 0 0 0-7.21-2.6c-4.19.38-7.64 3.75-8.1 7.94a9 9 0 0 0 17.87 2.14c.07-.6-.4-1.12-1-1.12c-.5 0-.92.37-.98.86c-.43 3.49-3.44 6.19-7.05 6.14c-3.71-.05-6.84-3.18-6.9-6.9C4.94 8.2 8.11 5 12 5c1.93 0 3.68.79 4.95 2.05l-2.09 2.09c-.32.32-.1.86.35.86h5.29c.28 0 .5-.22.5-.5"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ }
24
+ export {
25
+ IcRoundUpdate
26
+ };
@@ -0,0 +1,2 @@
1
+ import type { SVGProps } from 'react';
2
+ export declare function IcRoundVisibility(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import "../../chunks/chunk-U5RRZUYZ.js";
2
+
3
+ // src/ui/icons/IcRoundVisibility.tsx
4
+ import { jsx } from "react/jsx-runtime";
5
+ function IcRoundVisibility(props) {
6
+ return /* @__PURE__ */ jsx(
7
+ "svg",
8
+ {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ width: "1em",
11
+ height: "1em",
12
+ viewBox: "0 0 24 24",
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx(
15
+ "path",
16
+ {
17
+ fill: "currentColor",
18
+ d: "M12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5s5 2.24 5 5s-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3s3-1.34 3-3s-1.34-3-3-3"
19
+ }
20
+ )
21
+ }
22
+ );
23
+ }
24
+ export {
25
+ IcRoundVisibility
26
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "bin": "./dist/cli.js",
3
3
  "name": "alinea",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "description": "Headless git-based CMS",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,2 +0,0 @@
1
- import { SVGProps } from 'react';
2
- export declare function IcOutlineRemoveRedEye(props: SVGProps<SVGSVGElement>): import("react/jsx-runtime").JSX.Element;
@@ -1,26 +0,0 @@
1
- import "../../chunks/chunk-U5RRZUYZ.js";
2
-
3
- // src/ui/icons/IcOutlineRemoveRedEye.tsx
4
- import { jsx } from "react/jsx-runtime";
5
- function IcOutlineRemoveRedEye(props) {
6
- return /* @__PURE__ */ jsx(
7
- "svg",
8
- {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- width: "1em",
11
- height: "1em",
12
- viewBox: "0 0 24 24",
13
- ...props,
14
- children: /* @__PURE__ */ jsx(
15
- "path",
16
- {
17
- fill: "currentColor",
18
- d: "M12 6.5a9.77 9.77 0 0 1 8.82 5.5c-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12A9.77 9.77 0 0 1 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 5a2.5 2.5 0 0 1 0 5a2.5 2.5 0 0 1 0-5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5s4.5-2.02 4.5-4.5s-2.02-4.5-4.5-4.5z"
19
- }
20
- )
21
- }
22
- );
23
- }
24
- export {
25
- IcOutlineRemoveRedEye
26
- };