yarramate 1.25.1 → 1.25.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/adapters/visual/view-identity.d.ts +13 -0
- package/dist/adapters/visual/view-identity.js +29 -11
- package/dist/visual-app/assets/{elk.bundled-CLux5E_P.js → elk.bundled-ZYNFKdcv.js} +1 -1
- package/dist/visual-app/assets/{index-DGkU2CSB.js → index-CMqEmjU2.js} +2 -2
- package/dist/visual-app/index.html +1 -1
- package/dist/visual-app-lib/editor.js +15 -12
- package/dist/visual-app-lib/types/adapters/visual/view-identity.d.ts +13 -0
- package/package.json +1 -1
|
@@ -87,6 +87,19 @@ export interface SavedView {
|
|
|
87
87
|
readonly presentation: ProjectionDefinition["presentation"];
|
|
88
88
|
readonly path: string;
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The saved document for a view, from what the editor holds of it.
|
|
92
|
+
*
|
|
93
|
+
* An EMPTY title or description is written as no field at all (#509). The
|
|
94
|
+
* schema's `presentation.title` and `.description` are non-empty text, and
|
|
95
|
+
* the editor reads an undeclared description back as `""`; writing that
|
|
96
|
+
* string back made every membership edit to an undescribed view a document
|
|
97
|
+
* the schema refuses (YM201), so a subject added to five of the six
|
|
98
|
+
* ApertureX reference views could not be committed, since 1.0.0. The
|
|
99
|
+
* declared presentation is spread first and its own `title`/`description`
|
|
100
|
+
* set aside, so an emptied field is removed rather than kept from the
|
|
101
|
+
* declaration: the caller's value is the whole truth about those two.
|
|
102
|
+
*/
|
|
90
103
|
export declare const composeProjection: (input: {
|
|
91
104
|
readonly id: string;
|
|
92
105
|
readonly title: string;
|
|
@@ -106,17 +106,35 @@ export const duplicateView = (view, taken) => {
|
|
|
106
106
|
}),
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
109
|
+
/**
|
|
110
|
+
* The saved document for a view, from what the editor holds of it.
|
|
111
|
+
*
|
|
112
|
+
* An EMPTY title or description is written as no field at all (#509). The
|
|
113
|
+
* schema's `presentation.title` and `.description` are non-empty text, and
|
|
114
|
+
* the editor reads an undeclared description back as `""`; writing that
|
|
115
|
+
* string back made every membership edit to an undescribed view a document
|
|
116
|
+
* the schema refuses (YM201), so a subject added to five of the six
|
|
117
|
+
* ApertureX reference views could not be committed, since 1.0.0. The
|
|
118
|
+
* declared presentation is spread first and its own `title`/`description`
|
|
119
|
+
* set aside, so an emptied field is removed rather than kept from the
|
|
120
|
+
* declaration: the caller's value is the whole truth about those two.
|
|
121
|
+
*/
|
|
122
|
+
export const composeProjection = (input) => {
|
|
123
|
+
const { title: _title, description: _description, ...declared } = input.presentation ?? {};
|
|
124
|
+
return {
|
|
125
|
+
format: "yarramate/projection/v1",
|
|
126
|
+
id: input.id,
|
|
127
|
+
version: "1.0",
|
|
128
|
+
query: input.query,
|
|
129
|
+
presentation: {
|
|
130
|
+
...declared,
|
|
131
|
+
...(input.title.trim() === "" ? {} : { title: input.title }),
|
|
132
|
+
...(input.description.trim() === ""
|
|
133
|
+
? {}
|
|
134
|
+
: { description: input.description }),
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
};
|
|
120
138
|
/**
|
|
121
139
|
* Whether a view can be told which subjects it holds.
|
|
122
140
|
*
|