alinea 0.9.0 → 0.9.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.
- package/dist/chunks/{chunk-ZOF2XAUZ.js → chunk-74APDWPS.js} +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/generate/GenerateDashboard.js +1 -1
- package/dist/cloud/server/CloudAuthServer.js +1 -1
- package/dist/core/TextDoc.js +4 -2
- package/dist/core/Transaction.js +1 -1
- package/dist/core/Type.js +1 -8
- package/dist/core/pages/Cursor.js +1 -0
- package/dist/core/shape/RichTextShape.js +8 -2
- package/dist/dashboard/util/PersistentStore.js +1 -1
- package/dist/field/richtext/RichTextField.browser.js +2 -4
- package/dist/picker/entry/EntryPicker.js +4 -3
- package/dist/picker/url/UrlPicker.js +2 -0
- package/package.json +1 -1
package/dist/cli/Serve.js
CHANGED
package/dist/cli/bin.js
CHANGED
package/dist/core/TextDoc.js
CHANGED
|
@@ -9,11 +9,13 @@ var Node;
|
|
|
9
9
|
}
|
|
10
10
|
Node2.isText = isText;
|
|
11
11
|
function isElement(node) {
|
|
12
|
-
|
|
12
|
+
const typeName = node[Node2.type];
|
|
13
|
+
return typeof typeName === "string" && typeName !== "text" && typeName[0]?.toLowerCase() === typeName[0];
|
|
13
14
|
}
|
|
14
15
|
Node2.isElement = isElement;
|
|
15
16
|
function isBlock(node) {
|
|
16
|
-
|
|
17
|
+
const typeName = node[Node2.type];
|
|
18
|
+
return typeof typeName === "string" && typeName !== "text" && typeName[0]?.toUpperCase() === typeName[0];
|
|
17
19
|
}
|
|
18
20
|
Node2.isBlock = isBlock;
|
|
19
21
|
})(Node || (Node = {}));
|
package/dist/core/Transaction.js
CHANGED
|
@@ -41,7 +41,7 @@ var Operation = class _Operation {
|
|
|
41
41
|
const typeNames = Schema.typeNames(config.schema);
|
|
42
42
|
const typeName = typeNames.get(type);
|
|
43
43
|
if (!typeName)
|
|
44
|
-
throw new Error(`Type not found
|
|
44
|
+
throw new Error(`Type "${Type.label(type)}" not found in Schema`);
|
|
45
45
|
return typeName;
|
|
46
46
|
}
|
|
47
47
|
};
|
package/dist/core/Type.js
CHANGED
|
@@ -195,14 +195,7 @@ See: https://alinea.sh/docs/configuration/schema/type#fields-must-be-unique`
|
|
|
195
195
|
return Expr.and(...conditions)[Expr.Data];
|
|
196
196
|
}
|
|
197
197
|
call(...input) {
|
|
198
|
-
|
|
199
|
-
if (isConditionalRecord)
|
|
200
|
-
return new Cursor.Typed(this.target, input[0]);
|
|
201
|
-
else
|
|
202
|
-
return new Cursor.Find({
|
|
203
|
-
target: { type: this.target },
|
|
204
|
-
where: this.condition(input)
|
|
205
|
-
});
|
|
198
|
+
return new Cursor.Typed(this.target, input[0]);
|
|
206
199
|
}
|
|
207
200
|
field(def, name) {
|
|
208
201
|
return assign(Expr(ExprData.Field({ type: this.target }, name)), {
|
|
@@ -375,8 +375,14 @@ var RichTextShape = class {
|
|
|
375
375
|
if (!this.blocks)
|
|
376
376
|
throw new Error("No types defined");
|
|
377
377
|
const shape = this.blocks[block];
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
map.set(
|
|
379
|
+
id,
|
|
380
|
+
shape.toY({
|
|
381
|
+
...shape.create(),
|
|
382
|
+
[Node.type]: block,
|
|
383
|
+
[BlockNode.id]: id
|
|
384
|
+
})
|
|
385
|
+
);
|
|
380
386
|
}
|
|
381
387
|
};
|
|
382
388
|
}
|
|
@@ -1727,10 +1727,8 @@ function InsertMenu({ editor, schema, onInsert }) {
|
|
|
1727
1727
|
onClick: () => {
|
|
1728
1728
|
onInsert(id, key);
|
|
1729
1729
|
editor.chain().focus().insertContent({
|
|
1730
|
-
|
|
1731
|
-
attrs: {
|
|
1732
|
-
[BlockNode.id]: id
|
|
1733
|
-
}
|
|
1730
|
+
type: key,
|
|
1731
|
+
attrs: { [BlockNode.id]: id }
|
|
1734
1732
|
}).run();
|
|
1735
1733
|
},
|
|
1736
1734
|
children: /* @__PURE__ */ jsxs(HStack, { center: true, gap: 8, children: [
|
|
@@ -4,9 +4,10 @@ import "../../chunks/chunk-U5RRZUYZ.js";
|
|
|
4
4
|
import { Hint } from "alinea/core/Hint";
|
|
5
5
|
import { Reference } from "alinea/core/Reference";
|
|
6
6
|
import { Type, type } from "alinea/core/Type";
|
|
7
|
+
import { ListRow } from "alinea/core/shape/ListShape";
|
|
7
8
|
import { RecordShape } from "alinea/core/shape/RecordShape";
|
|
8
9
|
import { ScalarShape } from "alinea/core/shape/ScalarShape";
|
|
9
|
-
import { assign } from "alinea/core/util/Objects";
|
|
10
|
+
import { assign, keys } from "alinea/core/util/Objects";
|
|
10
11
|
import { EntryReference } from "./EntryReference.js";
|
|
11
12
|
function entryPicker(options) {
|
|
12
13
|
const fieldType = Type.isType(options.fields) ? options.fields : options.fields && type({ fields: options.fields });
|
|
@@ -27,11 +28,11 @@ function entryPicker(options) {
|
|
|
27
28
|
[Reference.id]: id,
|
|
28
29
|
[Reference.type]: type2,
|
|
29
30
|
[EntryReference.entry]: entryId,
|
|
31
|
+
[ListRow.index]: index,
|
|
30
32
|
...fields
|
|
31
33
|
} = row;
|
|
32
|
-
for (const key of
|
|
34
|
+
for (const key of keys(fields))
|
|
33
35
|
delete row[key];
|
|
34
|
-
row.id = entryId;
|
|
35
36
|
row.fields = fields;
|
|
36
37
|
if (!entryId)
|
|
37
38
|
return;
|
|
@@ -4,6 +4,7 @@ import "../../chunks/chunk-U5RRZUYZ.js";
|
|
|
4
4
|
import { Hint } from "alinea/core/Hint";
|
|
5
5
|
import { Reference } from "alinea/core/Reference";
|
|
6
6
|
import { Type, type } from "alinea/core/Type";
|
|
7
|
+
import { ListRow } from "alinea/core/shape/ListShape";
|
|
7
8
|
import { RecordShape } from "alinea/core/shape/RecordShape";
|
|
8
9
|
import { ScalarShape } from "alinea/core/shape/ScalarShape";
|
|
9
10
|
import { keys } from "alinea/core/util/Objects";
|
|
@@ -40,6 +41,7 @@ function urlPicker(options) {
|
|
|
40
41
|
[UrlReference.url]: url,
|
|
41
42
|
[UrlReference.title]: title,
|
|
42
43
|
[UrlReference.target]: target,
|
|
44
|
+
[ListRow.index]: index,
|
|
43
45
|
...fields
|
|
44
46
|
} = row;
|
|
45
47
|
const fieldKeys = keys(fields);
|