@lblod/ember-rdfa-editor-lblod-plugins 22.5.1 → 23.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/CHANGELOG.md +19 -0
- package/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.ts +1 -1
- package/addon/components/besluit-type-plugin/toolbar-dropdown.ts +1 -1
- package/addon/components/citation-plugin/citation-card.ts +1 -1
- package/addon/components/citation-plugin/citations/legal-document-detail.ts +1 -1
- package/addon/components/citation-plugin/citations/search-modal.ts +1 -1
- package/addon/components/lmb-plugin/search-modal.ts +1 -1
- package/addon/components/location-plugin/edit.gts +1 -1
- package/addon/components/lpdc-plugin/lpdc-modal.ts +1 -1
- package/addon/components/roadsign-regulation-plugin/measure-template.ts +1 -1
- package/addon/components/snippet-plugin/nodes/snippet.gts +83 -71
- package/addon/components/snippet-plugin/search-modal.ts +1 -1
- package/addon/components/snippet-plugin/snippet-insert.gts +9 -23
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.ts +1 -1
- package/addon/components/variable-plugin/address/edit.ts +1 -1
- package/addon/components/variable-plugin/codelist/edit.ts +1 -1
- package/addon/components/variable-plugin/codelist/insert.ts +1 -1
- package/addon/components/variable-plugin/location/edit.ts +1 -1
- package/addon/components/worship-plugin/search-modal.ts +1 -1
- package/addon/plugins/snippet-plugin/commands/insert-snippet.ts +91 -0
- package/addon/plugins/snippet-plugin/index.ts +3 -0
- package/addon/plugins/snippet-plugin/nodes/snippet.ts +10 -52
- package/app/styles/snippet-plugin.scss +5 -0
- package/declarations/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.d.ts +1 -1
- package/declarations/addon/components/besluit-type-plugin/toolbar-dropdown.d.ts +1 -1
- package/declarations/addon/components/citation-plugin/citation-card.d.ts +1 -1
- package/declarations/addon/components/citation-plugin/citations/legal-document-detail.d.ts +1 -1
- package/declarations/addon/components/citation-plugin/citations/search-modal.d.ts +1 -1
- package/declarations/addon/components/lmb-plugin/search-modal.d.ts +1 -1
- package/declarations/addon/components/location-plugin/edit.d.ts +1 -1
- package/declarations/addon/components/lpdc-plugin/lpdc-modal.d.ts +1 -1
- package/declarations/addon/components/roadsign-regulation-plugin/measure-template.d.ts +1 -1
- package/declarations/addon/components/snippet-plugin/search-modal.d.ts +1 -1
- package/declarations/addon/components/snippet-plugin/snippet-list/snippet-list-modal.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/address/edit.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/codelist/edit.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/codelist/insert.d.ts +1 -1
- package/declarations/addon/components/variable-plugin/location/edit.d.ts +1 -1
- package/declarations/addon/components/worship-plugin/search-modal.d.ts +1 -1
- package/declarations/addon/plugins/snippet-plugin/commands/insert-snippet.d.ts +14 -0
- package/declarations/addon/plugins/snippet-plugin/index.d.ts +2 -0
- package/declarations/addon/plugins/snippet-plugin/nodes/snippet.d.ts +5 -13
- package/package.json +6 -5
- package/pnpm-lock.yaml +99 -95
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
type PNode,
|
|
6
6
|
ProseParser,
|
|
7
7
|
rdfaAttrSpec,
|
|
8
|
-
type
|
|
9
|
-
type Transaction,
|
|
8
|
+
type Schema,
|
|
10
9
|
} from '@lblod/ember-rdfa-editor';
|
|
11
10
|
import {
|
|
12
11
|
renderRdfaAware,
|
|
@@ -23,8 +22,6 @@ import {
|
|
|
23
22
|
type EmberNodeConfig,
|
|
24
23
|
} from '@lblod/ember-rdfa-editor/utils/ember-node';
|
|
25
24
|
import { htmlToDoc } from '@lblod/ember-rdfa-editor/utils/_private/html-utils';
|
|
26
|
-
import { transactionCombinator } from '@lblod/ember-rdfa-editor/utils/transaction-utils';
|
|
27
|
-
import { addPropertyToNode } from '@lblod/ember-rdfa-editor/utils/rdfa-utils';
|
|
28
25
|
import SnippetComponent from '@lblod/ember-rdfa-editor-lblod-plugins/components/snippet-plugin/nodes/snippet';
|
|
29
26
|
import {
|
|
30
27
|
EXT,
|
|
@@ -33,13 +30,10 @@ import {
|
|
|
33
30
|
import { hasOutgoingNamedNodeTriple } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace';
|
|
34
31
|
import { jsonParse } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/strings';
|
|
35
32
|
import {
|
|
33
|
+
DEFAULT_CONTENT_STRING,
|
|
36
34
|
type ImportedResourceMap,
|
|
37
35
|
type SnippetPluginConfig,
|
|
38
36
|
} from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
39
|
-
import {
|
|
40
|
-
isSome,
|
|
41
|
-
unwrap,
|
|
42
|
-
} from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
43
37
|
|
|
44
38
|
function outgoingFromBacklink(
|
|
45
39
|
backlink: IncomingTriple,
|
|
@@ -64,11 +58,11 @@ function outgoingFromBacklink(
|
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
interface CreateSnippetArgs {
|
|
67
|
-
|
|
61
|
+
schema: Schema;
|
|
68
62
|
content: string;
|
|
69
63
|
title: string;
|
|
70
64
|
snippetListIds: string[];
|
|
71
|
-
importedResources
|
|
65
|
+
importedResources?: ImportedResourceMap;
|
|
72
66
|
}
|
|
73
67
|
|
|
74
68
|
/**
|
|
@@ -78,7 +72,7 @@ interface CreateSnippetArgs {
|
|
|
78
72
|
* properties that these resources will have after the snippet is inserted into the document.
|
|
79
73
|
**/
|
|
80
74
|
export function createSnippet({
|
|
81
|
-
|
|
75
|
+
schema,
|
|
82
76
|
content,
|
|
83
77
|
title,
|
|
84
78
|
snippetListIds,
|
|
@@ -93,13 +87,12 @@ export function createSnippet({
|
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
89
|
// Create the new node
|
|
96
|
-
const parser = ProseParser.fromSchema(
|
|
90
|
+
const parser = ProseParser.fromSchema(schema);
|
|
97
91
|
const contentAsNode = htmlToDoc(replacedContent, {
|
|
98
|
-
schema
|
|
92
|
+
schema,
|
|
99
93
|
parser,
|
|
100
|
-
editorView: controller.mainEditorView,
|
|
101
94
|
});
|
|
102
|
-
const node =
|
|
95
|
+
const node = schema.node(
|
|
103
96
|
'snippet',
|
|
104
97
|
{
|
|
105
98
|
assignedSnippetListsIds: snippetListIds,
|
|
@@ -111,7 +104,7 @@ export function createSnippet({
|
|
|
111
104
|
);
|
|
112
105
|
// Find all the new backlinks that refer to imported resources and generate OutgoingLinks for them
|
|
113
106
|
const importedTriples: Map<string, OutgoingTriple[]> = new Map();
|
|
114
|
-
if (Object.keys(importedResources).length > 0) {
|
|
107
|
+
if (Object.keys(importedResources ?? {}).length > 0) {
|
|
115
108
|
contentAsNode.descendants((node) => {
|
|
116
109
|
const backlinks = node.attrs.backlinks as IncomingTriple[] | undefined;
|
|
117
110
|
if (backlinks && backlinks.length > 0) {
|
|
@@ -135,41 +128,6 @@ export function createSnippet({
|
|
|
135
128
|
return [node, importedTriples];
|
|
136
129
|
}
|
|
137
130
|
|
|
138
|
-
/**
|
|
139
|
-
* Creates a Snippet node wrapping the given content while allowing for further snippets to be added
|
|
140
|
-
* or removed.
|
|
141
|
-
* Takes the same arguments object as creating a snippet but also a generator that produces a
|
|
142
|
-
* transaction that inserts the snippet into the document, so that this can be done in a way
|
|
143
|
-
* specific to the situation.
|
|
144
|
-
**/
|
|
145
|
-
export function createAndInsertSnippet(
|
|
146
|
-
createSnippetArgs: CreateSnippetArgs,
|
|
147
|
-
insertTransactionGenerator: (tr: Transaction, snippet: PNode) => Transaction,
|
|
148
|
-
) {
|
|
149
|
-
return createSnippetArgs.controller.withTransaction((tr, state) => {
|
|
150
|
-
const [snippet, importedTriples] = createSnippet(createSnippetArgs);
|
|
151
|
-
const result = transactionCombinator<boolean>(
|
|
152
|
-
state,
|
|
153
|
-
insertTransactionGenerator(tr, snippet),
|
|
154
|
-
)(
|
|
155
|
-
Object.values(createSnippetArgs.importedResources)
|
|
156
|
-
.map((linked) => {
|
|
157
|
-
const newProperties =
|
|
158
|
-
(isSome(linked) && importedTriples.get(linked)) || [];
|
|
159
|
-
return newProperties.map((newProp) =>
|
|
160
|
-
addPropertyToNode({
|
|
161
|
-
resource: unwrap(linked),
|
|
162
|
-
property: newProp,
|
|
163
|
-
}),
|
|
164
|
-
);
|
|
165
|
-
})
|
|
166
|
-
.flat(),
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
return result.transaction;
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
131
|
const emberNodeConfig = (options: SnippetPluginConfig): EmberNodeConfig => ({
|
|
174
132
|
name: 'snippet',
|
|
175
133
|
inline: false,
|
|
@@ -195,7 +153,7 @@ const emberNodeConfig = (options: SnippetPluginConfig): EmberNodeConfig => ({
|
|
|
195
153
|
config: { default: options },
|
|
196
154
|
},
|
|
197
155
|
component: SnippetComponent,
|
|
198
|
-
content:
|
|
156
|
+
content: options.allowedContent || DEFAULT_CONTENT_STRING,
|
|
199
157
|
serialize(node) {
|
|
200
158
|
return renderRdfaAware({
|
|
201
159
|
renderable: node,
|
|
@@ -140,6 +140,11 @@ div[typeof='besluitpublicatie:Documentonderdeel']
|
|
|
140
140
|
border-radius: 4px;
|
|
141
141
|
color: var(--au-blue-700);
|
|
142
142
|
cursor: pointer;
|
|
143
|
+
&.say-snippet-hidden {
|
|
144
|
+
color: transparent;
|
|
145
|
+
border: none;
|
|
146
|
+
cursor: auto;
|
|
147
|
+
}
|
|
143
148
|
&.say-snippet-remove-button {
|
|
144
149
|
color: var(--au-red-600);
|
|
145
150
|
border-color: var(--au-red-600);
|
package/declarations/addon/components/besluit-topic-plugin/besluit-topic-toolbar-dropdown.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export default class BesluitTopicToolbarDropdownComponent extends Component<Args
|
|
|
20
20
|
get doc(): import("prosemirror-model").Node;
|
|
21
21
|
get decisionRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
22
22
|
get showCard(): boolean;
|
|
23
|
-
topics: import("
|
|
23
|
+
topics: import("reactiveweb/function").State<Promise<BesluitTopic[]>>;
|
|
24
24
|
findBesluitTopicsByUris(uris: string[], topics?: BesluitTopic[] | null): BesluitTopic[] | undefined;
|
|
25
25
|
updateBesluitTopic(): void;
|
|
26
26
|
upsertBesluitTopic(selected: BesluitTopic[]): void;
|
|
@@ -26,7 +26,7 @@ export default class EditorPluginsToolbarDropdownComponent extends Component<Arg
|
|
|
26
26
|
constructor(parent: unknown, args: Args);
|
|
27
27
|
get controller(): SayController;
|
|
28
28
|
get doc(): import("prosemirror-model").Node;
|
|
29
|
-
types: import("
|
|
29
|
+
types: import("reactiveweb/function").State<Promise<BesluitType[]>>;
|
|
30
30
|
get currentBesluitRange(): import("@lblod/ember-rdfa-editor/plugins/datastore").ElementPNode | undefined;
|
|
31
31
|
get currentBesluitURI(): string | undefined;
|
|
32
32
|
get showCard(): boolean;
|
|
@@ -41,7 +41,7 @@ export default class CitationCardComponent extends Component<Args> {
|
|
|
41
41
|
onCardTextChange(event: InputEvent): void;
|
|
42
42
|
get governmentName(): string | undefined;
|
|
43
43
|
resourceSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<LegalDocument[]>>;
|
|
44
|
-
legalDocumentsResource: import("
|
|
44
|
+
legalDocumentsResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
45
45
|
selectLegislationType(type: string): void;
|
|
46
46
|
openLegalDocumentDetailModal(legalDocument: LegalDocument): void;
|
|
47
47
|
openSearchModal(): Promise<void>;
|
|
@@ -24,7 +24,7 @@ export default class LegalDocumentDetailComponent extends Component<Args> {
|
|
|
24
24
|
articleFilterAfterTimeout: string;
|
|
25
25
|
updateArticleFilter: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, (event: InputEvent) => Promise<void>>;
|
|
26
26
|
resourceSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/citation-plugin/utils/article").Article[]>>;
|
|
27
|
-
articleResource: import("
|
|
27
|
+
articleResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
28
28
|
close(): Promise<void>;
|
|
29
29
|
previousPage(): void;
|
|
30
30
|
nextPage(): void;
|
|
@@ -51,7 +51,7 @@ export default class EditorPluginsCitationsSearchModalComponent extends Componen
|
|
|
51
51
|
get searchText(): string;
|
|
52
52
|
get governmentSearchText(): string | undefined;
|
|
53
53
|
resourceSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<LegalDocument[]>>;
|
|
54
|
-
legalDocumentResource: import("
|
|
54
|
+
legalDocumentResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
55
55
|
get isBesluitType(): boolean;
|
|
56
56
|
setInputSearchText(event: InputEvent): void;
|
|
57
57
|
setGovernmentSearchText(event: InputEvent): void;
|
|
@@ -22,7 +22,7 @@ export default class LmbPluginSearchModalComponent extends Component<Args> {
|
|
|
22
22
|
results: Mandatee[];
|
|
23
23
|
totalCount: number;
|
|
24
24
|
} | undefined>>;
|
|
25
|
-
servicesResource: import("
|
|
25
|
+
servicesResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
26
26
|
setSort(sort: SearchSort): void;
|
|
27
27
|
setInputSearchText(event: InputEvent): void;
|
|
28
28
|
previousPage(): void;
|
|
@@ -44,7 +44,7 @@ export default class LocationPluginEditComponent extends Component<Signature> {
|
|
|
44
44
|
get canUpdateBusnumber(): string | undefined;
|
|
45
45
|
get alternativeAddressFromError(): Address | undefined;
|
|
46
46
|
resolveAddressTask: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<Address | undefined>>;
|
|
47
|
-
newAddress: import("
|
|
47
|
+
newAddress: import("reactiveweb/ember-concurrency").TaskInstance<Address | undefined>;
|
|
48
48
|
selectMunicipality(municipality: string): void;
|
|
49
49
|
selectStreet(street: string): void;
|
|
50
50
|
updateHousenumber(event: InputEvent): void;
|
|
@@ -36,7 +36,7 @@ export default class LpdcPluginModalComponent extends Component<Signature> {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
})>>;
|
|
39
|
-
lpdcResource: import("
|
|
39
|
+
lpdcResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
40
40
|
onSearchTextChange(event: InputEvent): void;
|
|
41
41
|
}
|
|
42
42
|
export {};
|
|
@@ -9,6 +9,6 @@ type Args = {
|
|
|
9
9
|
export default class MeasureTemplateComponent extends Component<Args> {
|
|
10
10
|
roadsignRegistry: RoadsignRegistryService;
|
|
11
11
|
get template(): string;
|
|
12
|
-
instructionData: import("
|
|
12
|
+
instructionData: import("reactiveweb/function").State<Promise<string>>;
|
|
13
13
|
}
|
|
14
14
|
export {};
|
|
@@ -18,7 +18,7 @@ export default class SnippetPluginSearchModalComponent extends Component<Args> {
|
|
|
18
18
|
setInputSearchText(event: InputEvent): void;
|
|
19
19
|
closeModal(): Promise<void>;
|
|
20
20
|
snippetsSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin").Snippet[]>>;
|
|
21
|
-
snippetsResource: import("
|
|
21
|
+
snippetsResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
22
22
|
previousPage(): void;
|
|
23
23
|
nextPage(): void;
|
|
24
24
|
}
|
|
@@ -19,7 +19,7 @@ export default class SnippetListModalComponent extends Component<Signature> {
|
|
|
19
19
|
closeModal(): void;
|
|
20
20
|
saveAndClose(): void;
|
|
21
21
|
snippetListSearch: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<SnippetList[]>>;
|
|
22
|
-
snippetListResource: import("
|
|
22
|
+
snippetListResource: import("reactiveweb/ember-concurrency").TaskInstance<SnippetList[]>;
|
|
23
23
|
onChange(assignedSnippetListsIds: string[]): void;
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -35,7 +35,7 @@ export default class AddressEditComponent extends Component<Args> {
|
|
|
35
35
|
get addressToInsert(): Address | null | undefined;
|
|
36
36
|
get canUpdateAddressVariable(): boolean;
|
|
37
37
|
resolveAddressTask: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<Address | undefined>>;
|
|
38
|
-
newAddress: import("
|
|
38
|
+
newAddress: import("reactiveweb/ember-concurrency").TaskInstance<Address | undefined>;
|
|
39
39
|
updateAddressVariable(): void;
|
|
40
40
|
selectMunicipality(municipality: string): void;
|
|
41
41
|
selectStreet(street: string): void;
|
|
@@ -19,7 +19,7 @@ export default class CodelistEditComponent extends Component<Args> {
|
|
|
19
19
|
get codelistUri(): string | undefined;
|
|
20
20
|
get showCard(): boolean;
|
|
21
21
|
get label(): string | undefined;
|
|
22
|
-
codelistOptions: import("
|
|
22
|
+
codelistOptions: import("reactiveweb/function").State<Promise<import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/fetch-data").CodeListOptions | undefined>>;
|
|
23
23
|
get multiSelect(): boolean;
|
|
24
24
|
insert(): void;
|
|
25
25
|
updateCodelistOption(codelistOption: CodeListOption | CodeListOption[]): void;
|
|
@@ -32,7 +32,7 @@ export default class CodelistInsertComponent extends Component<Args> {
|
|
|
32
32
|
label: string;
|
|
33
33
|
value: string;
|
|
34
34
|
} | undefined;
|
|
35
|
-
codelistData: import("
|
|
35
|
+
codelistData: import("reactiveweb/function").State<Promise<CodeList[]>>;
|
|
36
36
|
updateLabel(event: InputEvent): void;
|
|
37
37
|
insert(): void;
|
|
38
38
|
selectCodelist(codelist: CodeList): void;
|
|
@@ -23,7 +23,7 @@ export default class LocationEditComponent extends Component<Args> {
|
|
|
23
23
|
get source(): string;
|
|
24
24
|
get label(): string | undefined;
|
|
25
25
|
get isZonal(): boolean;
|
|
26
|
-
locationOptions: import("
|
|
26
|
+
locationOptions: import("reactiveweb/function").State<Promise<import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/variable-plugin/utils/fetch-data").CodeListOptions>>;
|
|
27
27
|
get multiSelect(): boolean;
|
|
28
28
|
updateLocationOption(locationOption: CodeListOption | CodeListOption[]): void;
|
|
29
29
|
}
|
|
@@ -22,7 +22,7 @@ export default class WorshipPluginSearchModalComponent extends Component<Args> {
|
|
|
22
22
|
setAdministrativeUnit(unit: AdministrativeUnit): void;
|
|
23
23
|
closeModal(): Promise<void>;
|
|
24
24
|
search: import("ember-concurrency").TaskForAsyncTaskFunction<unknown, () => Promise<import("@lblod/ember-rdfa-editor-lblod-plugins/plugins/worship-plugin/utils/fetchWorshipServices").WorshipServiceResponse>>;
|
|
25
|
-
servicesResource: import("
|
|
25
|
+
servicesResource: import("reactiveweb/ember-concurrency").TaskInstance<unknown>;
|
|
26
26
|
setSort(sort: SearchSort): void;
|
|
27
27
|
previousPage(): void;
|
|
28
28
|
nextPage(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { type ImportedResourceMap } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
3
|
+
export interface InsertSnippetCommandArgs {
|
|
4
|
+
content: string;
|
|
5
|
+
title: string;
|
|
6
|
+
assignedSnippetListsIds: string[];
|
|
7
|
+
importedResources?: ImportedResourceMap;
|
|
8
|
+
range?: {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const insertSnippet: ({ content, title, assignedSnippetListsIds, importedResources, range, }: InsertSnippetCommandArgs) => Command;
|
|
14
|
+
export default insertSnippet;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
2
2
|
import { SafeString } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
3
|
+
export declare const DEFAULT_CONTENT_STRING = "block+";
|
|
3
4
|
export type SnippetPluginConfig = {
|
|
4
5
|
endpoint: string;
|
|
6
|
+
allowedContent?: string;
|
|
5
7
|
};
|
|
6
8
|
interface SnippetArgs {
|
|
7
9
|
title: string | null;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type PNode, type
|
|
1
|
+
import { type PNode, type Schema } from '@lblod/ember-rdfa-editor';
|
|
2
2
|
import { type OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
3
3
|
import { type ImportedResourceMap, type SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
4
|
interface CreateSnippetArgs {
|
|
5
|
-
|
|
5
|
+
schema: Schema;
|
|
6
6
|
content: string;
|
|
7
7
|
title: string;
|
|
8
8
|
snippetListIds: string[];
|
|
9
|
-
importedResources
|
|
9
|
+
importedResources?: ImportedResourceMap;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Creates a Snippet node wrapping the given content while allowing for further snippets to be added
|
|
@@ -14,15 +14,7 @@ interface CreateSnippetArgs {
|
|
|
14
14
|
* @returns a tuple containing the Node and the map of imported resources to the new outgoing
|
|
15
15
|
* properties that these resources will have after the snippet is inserted into the document.
|
|
16
16
|
**/
|
|
17
|
-
export declare function createSnippet({
|
|
18
|
-
/**
|
|
19
|
-
* Creates a Snippet node wrapping the given content while allowing for further snippets to be added
|
|
20
|
-
* or removed.
|
|
21
|
-
* Takes the same arguments object as creating a snippet but also a generator that produces a
|
|
22
|
-
* transaction that inserts the snippet into the document, so that this can be done in a way
|
|
23
|
-
* specific to the situation.
|
|
24
|
-
**/
|
|
25
|
-
export declare function createAndInsertSnippet(createSnippetArgs: CreateSnippetArgs, insertTransactionGenerator: (tr: Transaction, snippet: PNode) => Transaction): void;
|
|
17
|
+
export declare function createSnippet({ schema, content, title, snippetListIds, importedResources, }: CreateSnippetArgs): [PNode, Map<string, OutgoingTriple[]>];
|
|
26
18
|
export declare const snippet: (config: SnippetPluginConfig) => import("@lblod/ember-rdfa-editor/core/say-node-spec").default;
|
|
27
|
-
export declare const snippetView: (config: SnippetPluginConfig) => (controller: SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
|
|
19
|
+
export declare const snippetView: (config: SnippetPluginConfig) => (controller: import("@lblod/ember-rdfa-editor").SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
|
|
28
20
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"codemirror": "^6.0.1",
|
|
66
66
|
"crypto-browserify": "^3.12.0",
|
|
67
67
|
"date-fns": "^2.30.0",
|
|
68
|
-
"ember-auto-import": "~2.
|
|
68
|
+
"ember-auto-import": "~2.7.0",
|
|
69
69
|
"ember-cli-babel": "^8.2.0",
|
|
70
70
|
"ember-cli-htmlbars": "^6.3.0",
|
|
71
71
|
"ember-concurrency": "^3.1.1",
|
|
72
72
|
"ember-mu-transform-helpers": "^2.1.2",
|
|
73
|
-
"ember-resources": "^
|
|
73
|
+
"ember-resources": "^7.0.2",
|
|
74
74
|
"ember-template-imports": "^4.1.1",
|
|
75
75
|
"ember-velcro": "^2.2.0",
|
|
76
76
|
"fetch-sparql-endpoint": "^3.3.3",
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
"proj4": "^2.11.0",
|
|
80
80
|
"rdf-ext": "^2.5.2",
|
|
81
81
|
"rdf-validate-shacl": "^0.4.5",
|
|
82
|
+
"reactiveweb": "^1.3.0",
|
|
82
83
|
"stream-browserify": "^3.0.0",
|
|
83
84
|
"tracked-built-ins": "^3.3.0",
|
|
84
85
|
"tracked-toolbox": "^2.0.0",
|
|
@@ -102,7 +103,7 @@
|
|
|
102
103
|
"@glint/template": "^1.4.0",
|
|
103
104
|
"@graphy/content.ttl.write": "^4.3.7",
|
|
104
105
|
"@graphy/memory.dataset.fast": "4.3.3",
|
|
105
|
-
"@lblod/ember-rdfa-editor": "
|
|
106
|
+
"@lblod/ember-rdfa-editor": "10.4.0",
|
|
106
107
|
"@rdfjs/types": "^1.1.0",
|
|
107
108
|
"@release-it/keep-a-changelog": "^4.0.0",
|
|
108
109
|
"@tsconfig/ember": "^3.0.8",
|
|
@@ -189,7 +190,7 @@
|
|
|
189
190
|
"@appuniversum/ember-appuniversum": "^3.4.1",
|
|
190
191
|
"@ember/string": "3.x",
|
|
191
192
|
"@glint/template": "^1.4.0",
|
|
192
|
-
"@lblod/ember-rdfa-editor": "^10.0
|
|
193
|
+
"@lblod/ember-rdfa-editor": "^10.4.0",
|
|
193
194
|
"ember-concurrency": "^3.1.0",
|
|
194
195
|
"ember-element-helper": "^0.8.6",
|
|
195
196
|
"ember-intl": "^7.0.0",
|