@coffer-org/plugin-documents 5.0.0 → 6.0.0
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/person_identity/index.js +1 -1
- package/dist/schema.js +16 -4
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ export default defineExtend({
|
|
|
5
5
|
label: 'documents.person_identity.label',
|
|
6
6
|
icon: 'lucide:globe',
|
|
7
7
|
attachTo: [{ library: 'people', shelf: 'person' }],
|
|
8
|
-
|
|
8
|
+
agent: `Canonical person identity (not tied to a physical document).
|
|
9
9
|
nationality — ISO alpha-2. variants — given/family name per language (field.keyed by lang: name+surname).`,
|
|
10
10
|
fields: {
|
|
11
11
|
nationality: field.string({
|
package/dist/schema.js
CHANGED
|
@@ -4687,6 +4687,13 @@ function wrapKey(key, opts, meta) {
|
|
|
4687
4687
|
editor: opts.editor
|
|
4688
4688
|
}
|
|
4689
4689
|
};
|
|
4690
|
+
if (opts.activate) m = {
|
|
4691
|
+
...m,
|
|
4692
|
+
hints: {
|
|
4693
|
+
...m.hints,
|
|
4694
|
+
activate: opts.activate
|
|
4695
|
+
}
|
|
4696
|
+
};
|
|
4690
4697
|
if (opts.span !== void 0) m = {
|
|
4691
4698
|
...m,
|
|
4692
4699
|
hints: {
|
|
@@ -4759,6 +4766,7 @@ function wrapKey(key, opts, meta) {
|
|
|
4759
4766
|
function normalizeOpts(rawIn) {
|
|
4760
4767
|
const raw = rawIn;
|
|
4761
4768
|
if (raw["view"] !== void 0) throw new Error("[normalizeOpts] `view` is gone — presentational options live in `ui: {}` (see CLAUDE.md § field author options and the field-types skill).");
|
|
4769
|
+
if (raw.ui?.["agent"] !== void 0) throw new Error("[normalizeOpts] `agent` is not presentation — declare it at the top level of the field call, not in `ui: {}`.");
|
|
4762
4770
|
const r = raw.rules ?? {};
|
|
4763
4771
|
const v = raw.ui ?? {};
|
|
4764
4772
|
const config = {};
|
|
@@ -4795,7 +4803,8 @@ function normalizeOpts(rawIn) {
|
|
|
4795
4803
|
emphasis: v.emphasis,
|
|
4796
4804
|
noLabel: v.noLabel,
|
|
4797
4805
|
role: v.role,
|
|
4798
|
-
editor: v.editor
|
|
4806
|
+
editor: v.editor,
|
|
4807
|
+
activate: v.activate
|
|
4799
4808
|
};
|
|
4800
4809
|
return Object.fromEntries(Object.entries(result).filter(([, val]) => val !== void 0));
|
|
4801
4810
|
}
|
|
@@ -5030,6 +5039,7 @@ function materialize(decl, name) {
|
|
|
5030
5039
|
const base = {
|
|
5031
5040
|
kind: type.kind,
|
|
5032
5041
|
label: opts.label ?? "",
|
|
5042
|
+
...opts.agent !== void 0 && { agent: opts.agent },
|
|
5033
5043
|
required,
|
|
5034
5044
|
prim: type.prim,
|
|
5035
5045
|
column: built.column,
|
|
@@ -5073,6 +5083,7 @@ function collectionGroup(key, opts, parts, collectionView) {
|
|
|
5073
5083
|
multiple: true,
|
|
5074
5084
|
required: opts.required ?? false,
|
|
5075
5085
|
label: opts.label ?? key,
|
|
5086
|
+
...opts.agent !== void 0 && { agent: opts.agent },
|
|
5076
5087
|
display: "wrap",
|
|
5077
5088
|
kind: collectionView,
|
|
5078
5089
|
fields: rowFields
|
|
@@ -10176,10 +10187,11 @@ var field = new Proxy({}, {
|
|
|
10176
10187
|
has: (_t, k) => k in composedField()
|
|
10177
10188
|
});
|
|
10178
10189
|
function toClient(field) {
|
|
10179
|
-
const { kind, label, required, prim, hints, options, strict, relation, json, hidden, derived, parts, cache } = field;
|
|
10190
|
+
const { kind, label, agent, required, prim, hints, options, strict, relation, json, hidden, derived, parts, cache } = field;
|
|
10180
10191
|
return {
|
|
10181
10192
|
kind,
|
|
10182
10193
|
label,
|
|
10194
|
+
...agent !== void 0 && { agent },
|
|
10183
10195
|
required,
|
|
10184
10196
|
prim,
|
|
10185
10197
|
hints,
|
|
@@ -10967,7 +10979,7 @@ function defineShelf(m) {
|
|
|
10967
10979
|
const keys = fieldEntries(built.fields).map(([k]) => k);
|
|
10968
10980
|
const dup = keys.find((k, i) => keys.indexOf(k) !== i);
|
|
10969
10981
|
if (dup) throw new Error(`[shelf] ${built.library}/${built.shelf}: duplicate key '${dup}'`);
|
|
10970
|
-
if (built.single && !built.
|
|
10982
|
+
if (built.single && !built.agent) throw new Error(`[shelf] ${built.library}/${built.shelf}: single shelf requires \`agent\` — the agent cannot find it otherwise`);
|
|
10971
10983
|
if (built.views?.list !== void 0 && !Array.isArray(built.views.list)) throw new Error(`[shelf] ${built.library}/${built.shelf}: views.list is a flat array of field keys — the { kind, fields } form is gone; use views.list: [...] plus views.listKind`);
|
|
10972
10984
|
if (built.standalone !== false && !built.single && !built.views?.list?.length) console.warn(`[shelf] ${built.library}/${built.shelf}: standalone shelf without an explicit views.list`);
|
|
10973
10985
|
if (built.views?.title && !ownFieldEntries(built.fields).some(([k]) => k === built.views.title)) throw new Error(`[shelf] ${built.library}/${built.shelf}: views.title '${built.views.title}' is not a field`);
|
|
@@ -11184,7 +11196,7 @@ var person_identity_default = defineExtend({
|
|
|
11184
11196
|
library: "people",
|
|
11185
11197
|
shelf: "person"
|
|
11186
11198
|
}],
|
|
11187
|
-
|
|
11199
|
+
agent: `Canonical person identity (not tied to a physical document).
|
|
11188
11200
|
nationality — ISO alpha-2. variants — given/family name per language (field.keyed by lang: name+surname).`,
|
|
11189
11201
|
fields: {
|
|
11190
11202
|
nationality: field.string({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/plugin-documents",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"postpack": "node ../../scripts/swap-exports.mjs src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@coffer-org/plugin-people": "^
|
|
30
|
-
"@coffer-org/sdk": "^
|
|
31
|
-
"@coffer-org/server": "^
|
|
29
|
+
"@coffer-org/plugin-people": "^6.0.0",
|
|
30
|
+
"@coffer-org/sdk": "^6.0.0",
|
|
31
|
+
"@coffer-org/server": "^6.0.0"
|
|
32
32
|
},
|
|
33
33
|
"coffer": {
|
|
34
34
|
"runtime": "node",
|