@lblod/ember-rdfa-editor-lblod-plugins 22.4.1 → 22.5.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 +18 -0
- package/addon/components/auto-resizing-text-area.gts +43 -0
- package/addon/components/lmb-plugin/list.hbs +1 -1
- package/addon/components/lmb-plugin/search-modal.hbs +10 -7
- package/addon/components/lmb-plugin/search-modal.ts +8 -1
- package/addon/components/mandatee-table-plugin/configure.gts +4 -4
- package/addon/components/mandatee-table-plugin/node.gts +1 -1
- package/addon/components/snippet-plugin/nodes/snippet.gts +17 -30
- package/addon/components/snippet-plugin/search-modal.ts +1 -1
- package/addon/components/snippet-plugin/snippet-insert-placeholder.gts +15 -14
- package/addon/components/snippet-plugin/snippet-insert-rdfa.gts +82 -0
- package/addon/components/snippet-plugin/snippet-insert.gts +109 -0
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.hbs +1 -1
- package/addon/components/snippet-plugin/snippet-list/snippet-list-modal.ts +8 -11
- package/addon/components/snippet-plugin/snippet-list/snippet-list-view.hbs +4 -1
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.gts +25 -0
- package/addon/components/snippet-plugin/snippet-list-select.gts +104 -0
- package/addon/plugins/mandatee-table-plugin/node.ts +5 -1
- package/addon/plugins/snippet-plugin/commands/index.ts +1 -1
- package/addon/plugins/snippet-plugin/commands/{update-snippet-ids.ts → update-snippet-placeholder.ts} +23 -12
- package/addon/plugins/snippet-plugin/index.ts +19 -11
- package/addon/plugins/snippet-plugin/nodes/snippet-placeholder.ts +27 -9
- package/addon/plugins/snippet-plugin/nodes/snippet.ts +160 -2
- package/addon/plugins/snippet-plugin/utils/collate-imported-resources.ts +22 -0
- package/addon/plugins/snippet-plugin/utils/fetch-data.ts +52 -36
- package/addon/plugins/snippet-plugin/utils/rdfa-predicate.ts +3 -15
- package/addon/utils/sparql-helpers.ts +3 -4
- package/addon/utils/strings.ts +13 -0
- package/app/styles/mandatee-table-plugin.scss +5 -0
- package/declarations/addon/components/auto-resizing-text-area.d.ts +22 -0
- package/declarations/addon/components/snippet-plugin/nodes/snippet.d.ts +1 -1
- package/declarations/addon/components/snippet-plugin/search-modal.d.ts +1 -1
- package/declarations/addon/components/snippet-plugin/snippet-insert-placeholder.d.ts +2 -2
- package/declarations/addon/components/snippet-plugin/snippet-insert-rdfa.d.ts +13 -13
- package/declarations/addon/components/snippet-plugin/snippet-insert.d.ts +13 -9
- package/declarations/addon/components/snippet-plugin/snippet-list/snippet-list-modal.d.ts +2 -2
- package/declarations/addon/components/snippet-plugin/snippet-list-select-rdfa.d.ts +15 -19
- package/declarations/addon/components/snippet-plugin/snippet-list-select.d.ts +13 -5
- package/declarations/addon/plugins/snippet-plugin/commands/index.d.ts +1 -1
- package/declarations/addon/plugins/snippet-plugin/commands/update-snippet-placeholder.d.ts +11 -0
- package/declarations/addon/plugins/snippet-plugin/index.d.ts +12 -8
- package/declarations/addon/plugins/snippet-plugin/nodes/snippet-placeholder.d.ts +5 -1
- package/declarations/addon/plugins/snippet-plugin/nodes/snippet.d.ts +27 -2
- package/declarations/addon/plugins/snippet-plugin/utils/collate-imported-resources.d.ts +2 -0
- package/declarations/addon/plugins/snippet-plugin/utils/fetch-data.d.ts +0 -1
- package/declarations/addon/plugins/snippet-plugin/utils/rdfa-predicate.d.ts +1 -1
- package/declarations/addon/utils/sparql-helpers.d.ts +5 -3
- package/declarations/addon/utils/strings.d.ts +2 -0
- package/package.json +3 -3
- package/pnpm-lock.yaml +29 -29
- package/translations/en-US.yaml +1 -0
- package/translations/nl-BE.yaml +1 -0
- package/addon/components/snippet-plugin/snippet-insert-rdfa.hbs +0 -7
- package/addon/components/snippet-plugin/snippet-insert-rdfa.ts +0 -78
- package/addon/components/snippet-plugin/snippet-insert.hbs +0 -20
- package/addon/components/snippet-plugin/snippet-insert.ts +0 -95
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.hbs +0 -8
- package/addon/components/snippet-plugin/snippet-list-select-rdfa.ts +0 -68
- package/addon/components/snippet-plugin/snippet-list-select.hbs +0 -17
- package/addon/components/snippet-plugin/snippet-list-select.ts +0 -29
- package/declarations/addon/plugins/snippet-plugin/commands/update-snippet-ids.d.ts +0 -11
|
@@ -11,23 +11,11 @@ export const getSnippetListIdsProperties = (node: PNode) => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const getAssignedSnippetListsIdsFromProperties = (
|
|
14
|
-
snippetListIdsProperty: OutgoingTriple[] | undefined,
|
|
14
|
+
snippetListIdsProperty: OutgoingTriple[] | undefined = [],
|
|
15
15
|
) => {
|
|
16
|
-
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const snippetListUris = snippetListIdsProperty
|
|
16
|
+
return snippetListIdsProperty
|
|
21
17
|
.map((property) => property.object.value)
|
|
22
|
-
.filter((object) => object !== undefined)
|
|
23
|
-
|
|
24
|
-
if (snippetListUris.length === 0) {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const snippetListIds = snippetListUris
|
|
18
|
+
.filter((object) => object !== undefined)
|
|
29
19
|
.map(getSnippetIdFromUri)
|
|
30
20
|
.filter((id) => id !== undefined);
|
|
31
|
-
|
|
32
|
-
return snippetListIds;
|
|
33
21
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as RDF from '@rdfjs/types';
|
|
2
2
|
import { optionMapOr } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
3
3
|
|
|
4
|
-
export type BindingObject<Obj extends Record<string, string>> =
|
|
5
|
-
keyof Obj
|
|
6
|
-
|
|
7
|
-
>;
|
|
4
|
+
export type BindingObject<Obj extends Record<string, string | string[]>> = {
|
|
5
|
+
[Prop in keyof Obj]: { value: string };
|
|
6
|
+
};
|
|
8
7
|
|
|
9
8
|
export interface QueryResult<Binding = Record<string, RDF.Term>> {
|
|
10
9
|
results: {
|
package/addon/utils/strings.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { warn } from '@ember/debug';
|
|
2
|
+
import { isNone, type Option } from './option';
|
|
2
3
|
|
|
3
4
|
const STRING_CAPITALIZE_REGEXP = /(^|\/)([a-z\u00C0-\u024F])/g;
|
|
4
5
|
export function capitalize(value: string): string {
|
|
@@ -48,3 +49,15 @@ export function isNumber(value: string | number | null | undefined): boolean {
|
|
|
48
49
|
value !== '')
|
|
49
50
|
);
|
|
50
51
|
}
|
|
52
|
+
|
|
53
|
+
export function jsonParse<T = unknown>(json: Option<string>): T | undefined {
|
|
54
|
+
if (isNone(json)) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
return JSON.parse(json);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
console.warn('unable to parse JSON', json, err);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { AuTextareaSignature } from '@appuniversum/ember-appuniversum/components/au-textarea';
|
|
3
|
+
interface Sig {
|
|
4
|
+
Args: {
|
|
5
|
+
maxHeight?: number;
|
|
6
|
+
} & AuTextareaSignature['Args'];
|
|
7
|
+
Blocks: {
|
|
8
|
+
default: [];
|
|
9
|
+
};
|
|
10
|
+
Element: HTMLTextAreaElement;
|
|
11
|
+
}
|
|
12
|
+
export default class AutoResizingTextArea extends Component<Sig> {
|
|
13
|
+
setupAutoResize: import("ember-modifier").FunctionBasedModifier<{
|
|
14
|
+
Args: {
|
|
15
|
+
Positional: unknown[];
|
|
16
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
17
|
+
};
|
|
18
|
+
Element: HTMLTextAreaElement;
|
|
19
|
+
}>;
|
|
20
|
+
onInput(): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { type EmberNodeArgs } from '@lblod/ember-rdfa-editor/utils/_private/ember-node';
|
|
3
|
-
import { PNode, Selection, Slice } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { type PNode, type Selection, Slice } from '@lblod/ember-rdfa-editor';
|
|
4
4
|
interface Signature {
|
|
5
5
|
Args: EmberNodeArgs;
|
|
6
6
|
Blocks: {
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
3
3
|
interface Args {
|
|
4
4
|
config: SnippetPluginConfig;
|
|
5
|
-
assignedSnippetListsIds: string[];
|
|
5
|
+
assignedSnippetListsIds: string[] | undefined;
|
|
6
6
|
closeModal: () => void;
|
|
7
7
|
open: boolean;
|
|
8
8
|
onInsert: (content: string, title: string) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { type NodeType, type SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { type SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
3
|
+
import { type SnippetPluginConfig, type SnippetList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
4
|
interface Signature {
|
|
5
5
|
Args: {
|
|
6
6
|
controller: SayController;
|
|
@@ -12,6 +12,6 @@ export default class SnippetPluginSnippetInsertPlaceholder extends Component<Sig
|
|
|
12
12
|
get placeholderNode(): NodeType | undefined;
|
|
13
13
|
openModal(): void;
|
|
14
14
|
closeModal(): void;
|
|
15
|
-
insertPlaceholder(
|
|
15
|
+
insertPlaceholder(lists: SnippetList[] | undefined): void;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
-
import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
|
-
import { OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
3
|
+
import { type ImportedResourceMap, type SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
5
4
|
import { ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
6
|
-
interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
interface Sig {
|
|
6
|
+
Args: {
|
|
7
|
+
controller: SayController;
|
|
8
|
+
config: SnippetPluginConfig;
|
|
9
|
+
node: ResolvedPNode;
|
|
10
|
+
};
|
|
10
11
|
}
|
|
11
|
-
export default class SnippetInsertRdfaComponent extends Component<
|
|
12
|
-
get
|
|
13
|
-
get
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
get assignedSnippetListsIds(): string[];
|
|
12
|
+
export default class SnippetInsertRdfaComponent extends Component<Sig> {
|
|
13
|
+
get disableInsert(): boolean;
|
|
14
|
+
get snippetListProperties(): {
|
|
15
|
+
listIds: string[];
|
|
16
|
+
importedResources: ImportedResourceMap;
|
|
17
|
+
} | undefined;
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import { SayController, Slice } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { type SayController, Slice } from '@lblod/ember-rdfa-editor';
|
|
3
3
|
import { SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { type ImportedResourceMap } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
5
|
+
interface Sig {
|
|
6
|
+
Args: {
|
|
7
|
+
controller: SayController;
|
|
8
|
+
config: SnippetPluginConfig;
|
|
9
|
+
snippetListProperties: {
|
|
10
|
+
listIds: string[];
|
|
11
|
+
importedResources: ImportedResourceMap;
|
|
12
|
+
} | undefined;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
9
15
|
}
|
|
10
|
-
export default class SnippetInsertComponent extends Component<
|
|
11
|
-
AddIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/add").AddIconSignature>;
|
|
16
|
+
export default class SnippetInsertComponent extends Component<Sig> {
|
|
12
17
|
showModal: boolean;
|
|
13
18
|
get controller(): SayController;
|
|
14
|
-
get config(): SnippetPluginConfig;
|
|
15
19
|
openModal(): void;
|
|
16
20
|
closeModal(): void;
|
|
17
21
|
createSliceFromElement(element: Element): Slice;
|
|
@@ -4,8 +4,8 @@ import { SnippetPluginConfig, SnippetList } from '@lblod/ember-rdfa-editor-lblod
|
|
|
4
4
|
interface Signature {
|
|
5
5
|
Args: {
|
|
6
6
|
config: SnippetPluginConfig;
|
|
7
|
-
|
|
8
|
-
assignedSnippetListsIds: string[];
|
|
7
|
+
onSaveSnippetLists: (lists: SnippetList[]) => void;
|
|
8
|
+
assignedSnippetListsIds: string[] | undefined;
|
|
9
9
|
closeModal: () => void;
|
|
10
10
|
open: boolean;
|
|
11
11
|
};
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
/// <reference types=".pnpm/ember-source@4.12.0_@babel+core@7.24.7_@glimmer+component@1.1.2_@babel+core@7.24.7__@glint+template@1.4.0_webpack@5.92.1/node_modules/ember-source/types/stable/@ember/component/template-only" />
|
|
2
|
+
/// <reference types="@glint/environment-ember-loose/-private/dsl/integration-declarations" />
|
|
3
|
+
import { TemplateOnlyComponent } from '@ember/component/template-only';
|
|
4
4
|
import { SayController } from '@lblod/ember-rdfa-editor';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { type ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
6
|
+
import { type SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
7
|
+
interface Sig {
|
|
8
|
+
Args: {
|
|
9
|
+
controller: SayController;
|
|
10
|
+
config: SnippetPluginConfig;
|
|
11
|
+
node: ResolvedPNode;
|
|
12
|
+
};
|
|
10
13
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
get currentResource(): string | undefined;
|
|
16
|
-
get isResourceNode(): boolean;
|
|
17
|
-
get snippetListIdsProperties(): OutgoingTriple[];
|
|
18
|
-
get assignedSnippetListsIds(): string[];
|
|
19
|
-
saveChanges: (snippetIds: string[], snippetNames: string[]) => void;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
|
14
|
+
/** @deprecated Use snippet-list-select directly */
|
|
15
|
+
declare const SnippetListSelectRdfaComponent: TemplateOnlyComponent<Sig>;
|
|
16
|
+
/** @deprecated Use snippet-list-select directly */
|
|
17
|
+
export default SnippetListSelectRdfaComponent;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
-
import {
|
|
2
|
+
import { type SayController } from '@lblod/ember-rdfa-editor';
|
|
3
|
+
import { type ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
4
|
+
import { type OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
5
|
+
import { type ImportedResourceMap, type SnippetPluginConfig, type SnippetList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
3
6
|
interface Signature {
|
|
4
7
|
Args: {
|
|
8
|
+
controller: SayController;
|
|
5
9
|
config: SnippetPluginConfig;
|
|
6
|
-
|
|
7
|
-
onSaveSnippetListIds: (listIds: string[]) => void;
|
|
10
|
+
node: ResolvedPNode;
|
|
8
11
|
};
|
|
9
12
|
}
|
|
10
|
-
export default class
|
|
11
|
-
UnorderedListIcon: TOC<import("@appuniversum/ember-appuniversum/components/icons/unordered-list").UnorderedListIconSignature>;
|
|
13
|
+
export default class SnippetListSelect extends Component<Signature> {
|
|
12
14
|
showModal: boolean;
|
|
13
15
|
openModal(): void;
|
|
14
16
|
closeModal(): void;
|
|
17
|
+
get currentResource(): string | undefined;
|
|
18
|
+
get isResourceNode(): boolean;
|
|
19
|
+
get snippetListIdsProperties(): OutgoingTriple[];
|
|
20
|
+
get assignedSnippetListsIds(): string[];
|
|
21
|
+
get imported(): ImportedResourceMap;
|
|
22
|
+
onSaveSnippetLists(lists: SnippetList[]): void;
|
|
15
23
|
}
|
|
16
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { updateSnippetPlaceholder } from './update-snippet-placeholder';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { type OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
3
|
+
import { type ResolvedPNode } from '@lblod/ember-rdfa-editor/utils/_private/types';
|
|
4
|
+
import { type ImportedResourceMap, type SnippetList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
5
|
+
export declare const updateSnippetPlaceholder: ({ resource, oldSnippetProperties, newSnippetLists, oldImportedResources, node, }: {
|
|
6
|
+
resource: string;
|
|
7
|
+
oldSnippetProperties: OutgoingTriple[];
|
|
8
|
+
newSnippetLists: SnippetList[];
|
|
9
|
+
oldImportedResources: ImportedResourceMap;
|
|
10
|
+
node: ResolvedPNode;
|
|
11
|
+
}) => Command;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Option } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/option';
|
|
1
2
|
import { SafeString } from '@lblod/ember-rdfa-editor-lblod-plugins/utils/types';
|
|
2
3
|
export type SnippetPluginConfig = {
|
|
3
4
|
endpoint: string;
|
|
@@ -13,17 +14,20 @@ export declare class Snippet {
|
|
|
13
14
|
title: string | null;
|
|
14
15
|
constructor({ title, createdOn, content }: SnippetArgs);
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
export type ImportedResourceMap = Record<string, Option<string>>;
|
|
18
|
+
export type SnippetListArgs = {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
createdOn: string;
|
|
22
|
+
importedResources: string[];
|
|
23
|
+
};
|
|
21
24
|
export declare const getSnippetUriFromId: (id: string) => string;
|
|
22
25
|
export declare const getSnippetIdFromUri: (uri: string) => string;
|
|
23
26
|
export declare class SnippetList {
|
|
24
|
-
id: string
|
|
25
|
-
label: string
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
26
29
|
createdOn: string | null;
|
|
27
|
-
|
|
30
|
+
importedResources: string[];
|
|
31
|
+
constructor({ id, label, createdOn, importedResources }: SnippetListArgs);
|
|
28
32
|
}
|
|
29
33
|
export {};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type Schema } from '@lblod/ember-rdfa-editor';
|
|
2
|
-
|
|
2
|
+
import { type ImportedResourceMap, type SnippetList } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
3
|
+
export declare function importedResourcesFromSnippetLists(lists: SnippetList[], existing?: ImportedResourceMap): {
|
|
4
|
+
[k: string]: import("../../../utils/option").Option<string>;
|
|
5
|
+
};
|
|
6
|
+
export declare function createSnippetPlaceholder(lists: SnippetList[], schema: Schema): import("prosemirror-model").Node;
|
|
3
7
|
export declare const snippetPlaceholder: import("@lblod/ember-rdfa-editor/core/say-node-spec").default;
|
|
4
8
|
export declare const snippetPlaceholderView: (controller: import("@lblod/ember-rdfa-editor").SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type PNode, type SayController, type Transaction } from '@lblod/ember-rdfa-editor';
|
|
2
|
+
import { type OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
3
|
+
import { type ImportedResourceMap, type SnippetPluginConfig } from '@lblod/ember-rdfa-editor-lblod-plugins/plugins/snippet-plugin';
|
|
4
|
+
interface CreateSnippetArgs {
|
|
5
|
+
controller: SayController;
|
|
6
|
+
content: string;
|
|
7
|
+
title: string;
|
|
8
|
+
snippetListIds: string[];
|
|
9
|
+
importedResources: ImportedResourceMap;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates a Snippet node wrapping the given content while allowing for further snippets to be added
|
|
13
|
+
* or removed. Takes care of linking imported resources.
|
|
14
|
+
* @returns a tuple containing the Node and the map of imported resources to the new outgoing
|
|
15
|
+
* properties that these resources will have after the snippet is inserted into the document.
|
|
16
|
+
**/
|
|
17
|
+
export declare function createSnippet({ controller, content, title, snippetListIds, importedResources, }: CreateSnippetArgs): [PNode, Map<string, OutgoingTriple[]>];
|
|
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;
|
|
2
26
|
export declare const snippet: (config: SnippetPluginConfig) => import("@lblod/ember-rdfa-editor/core/say-node-spec").default;
|
|
3
|
-
export declare const snippetView: (config: SnippetPluginConfig) => (controller:
|
|
27
|
+
export declare const snippetView: (config: SnippetPluginConfig) => (controller: SayController) => import("@lblod/ember-rdfa-editor/utils/ember-node").SayNodeViewConstructor;
|
|
28
|
+
export {};
|
|
@@ -2,4 +2,4 @@ import { PNode } from '@lblod/ember-rdfa-editor';
|
|
|
2
2
|
import { OutgoingTriple } from '@lblod/ember-rdfa-editor/core/rdfa-processor';
|
|
3
3
|
export declare const SNIPPET_LIST_RDFA_PREDICATE: import("@lblod/ember-rdfa-editor-lblod-plugins/utils/namespace").Resource;
|
|
4
4
|
export declare const getSnippetListIdsProperties: (node: PNode) => OutgoingTriple[];
|
|
5
|
-
export declare const getAssignedSnippetListsIdsFromProperties: (snippetListIdsProperty
|
|
5
|
+
export declare const getAssignedSnippetListsIdsFromProperties: (snippetListIdsProperty?: OutgoingTriple[] | undefined) => string[];
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as RDF from '@rdfjs/types';
|
|
2
|
-
export type BindingObject<Obj extends Record<string, string>> =
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type BindingObject<Obj extends Record<string, string | string[]>> = {
|
|
3
|
+
[Prop in keyof Obj]: {
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
5
7
|
export interface QueryResult<Binding = Record<string, RDF.Term>> {
|
|
6
8
|
results: {
|
|
7
9
|
bindings: Binding[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type Option } from './option';
|
|
1
2
|
export declare function capitalize(value: string): string;
|
|
2
3
|
export declare function escapeValue(value?: string): string | null;
|
|
3
4
|
export declare function dateValue(value?: string): string | null;
|
|
4
5
|
export declare function isNumber(value: string | number | null | undefined): boolean;
|
|
6
|
+
export declare function jsonParse<T = unknown>(json: Option<string>): T | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lblod/ember-rdfa-editor-lblod-plugins",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.5.0",
|
|
4
4
|
"description": "Ember addon providing lblod specific plugins for the ember-rdfa-editor",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@glint/template": "^1.4.0",
|
|
103
103
|
"@graphy/content.ttl.write": "^4.3.7",
|
|
104
104
|
"@graphy/memory.dataset.fast": "4.3.3",
|
|
105
|
-
"@lblod/ember-rdfa-editor": "10.0
|
|
105
|
+
"@lblod/ember-rdfa-editor": "^10.4.0",
|
|
106
106
|
"@rdfjs/types": "^1.1.0",
|
|
107
107
|
"@release-it/keep-a-changelog": "^4.0.0",
|
|
108
108
|
"@tsconfig/ember": "^3.0.8",
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
"@appuniversum/ember-appuniversum": "^3.4.1",
|
|
190
190
|
"@ember/string": "3.x",
|
|
191
191
|
"@glint/template": "^1.4.0",
|
|
192
|
-
"@lblod/ember-rdfa-editor": "^10.
|
|
192
|
+
"@lblod/ember-rdfa-editor": "^10.4.0",
|
|
193
193
|
"ember-concurrency": "^3.1.0",
|
|
194
194
|
"ember-element-helper": "^0.8.6",
|
|
195
195
|
"ember-intl": "^7.0.0",
|
package/pnpm-lock.yaml
CHANGED
|
@@ -160,8 +160,8 @@ importers:
|
|
|
160
160
|
specifier: 4.3.3
|
|
161
161
|
version: 4.3.3
|
|
162
162
|
'@lblod/ember-rdfa-editor':
|
|
163
|
-
specifier: 10.0
|
|
164
|
-
version: 10.0
|
|
163
|
+
specifier: ^10.4.0
|
|
164
|
+
version: 10.4.0(2ef3gpurqxbttnmniw6grhzpuy)
|
|
165
165
|
'@rdfjs/types':
|
|
166
166
|
specifier: ^1.1.0
|
|
167
167
|
version: 1.1.0
|
|
@@ -1586,8 +1586,8 @@ packages:
|
|
|
1586
1586
|
'@jridgewell/trace-mapping@0.3.25':
|
|
1587
1587
|
resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
|
|
1588
1588
|
|
|
1589
|
-
'@lblod/ember-rdfa-editor@10.0
|
|
1590
|
-
resolution: {integrity: sha512-
|
|
1589
|
+
'@lblod/ember-rdfa-editor@10.4.0':
|
|
1590
|
+
resolution: {integrity: sha512-rmSMmJj6Xbxg2v1xHo3wtJbfpwzrzm1mmKRc2vTsG3ho64V4QQE7IWD2PdnutEMYVYEQKet0W653tHAT8Em/1w==}
|
|
1591
1591
|
engines: {node: 16.* || 18.* || >= 20}
|
|
1592
1592
|
peerDependencies:
|
|
1593
1593
|
'@appuniversum/ember-appuniversum': ^3.4.2
|
|
@@ -2599,8 +2599,8 @@ packages:
|
|
|
2599
2599
|
async@2.6.4:
|
|
2600
2600
|
resolution: {integrity: sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==}
|
|
2601
2601
|
|
|
2602
|
-
async@3.2.
|
|
2603
|
-
resolution: {integrity: sha512-
|
|
2602
|
+
async@3.2.6:
|
|
2603
|
+
resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==}
|
|
2604
2604
|
|
|
2605
2605
|
at-least-node@1.0.0:
|
|
2606
2606
|
resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==}
|
|
@@ -3885,8 +3885,8 @@ packages:
|
|
|
3885
3885
|
resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==}
|
|
3886
3886
|
engines: {node: '>=0.4', npm: '>=1.2'}
|
|
3887
3887
|
|
|
3888
|
-
dompurify@3.1.
|
|
3889
|
-
resolution: {integrity: sha512-
|
|
3888
|
+
dompurify@3.1.6:
|
|
3889
|
+
resolution: {integrity: sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==}
|
|
3890
3890
|
|
|
3891
3891
|
dot-case@3.0.4:
|
|
3892
3892
|
resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}
|
|
@@ -7265,8 +7265,8 @@ packages:
|
|
|
7265
7265
|
property-expr@2.0.6:
|
|
7266
7266
|
resolution: {integrity: sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==}
|
|
7267
7267
|
|
|
7268
|
-
prosemirror-commands@1.
|
|
7269
|
-
resolution: {integrity: sha512-
|
|
7268
|
+
prosemirror-commands@1.6.0:
|
|
7269
|
+
resolution: {integrity: sha512-xn1U/g36OqXn2tn5nGmvnnimAj/g1pUx2ypJJIe8WkVX83WyJVC5LTARaxZa2AtQRwntu9Jc5zXs9gL9svp/mg==}
|
|
7270
7270
|
|
|
7271
7271
|
prosemirror-dev-tools@4.1.0:
|
|
7272
7272
|
resolution: {integrity: sha512-TqMyXLiY8EUoq4f4LV+8dQVuRejwGfeOJdJWjrHNXR9ttKy3MVYBCqmiu3CDULgjv8gtLsqoZY6+ab6BZRmr1g==}
|
|
@@ -7278,8 +7278,8 @@ packages:
|
|
|
7278
7278
|
prosemirror-dropcursor@1.8.1:
|
|
7279
7279
|
resolution: {integrity: sha512-M30WJdJZLyXHi3N8vxN6Zh5O8ZBbQCz0gURTfPmTIBNQ5pxrdU7A58QkNqfa98YEjSAL1HUyyU34f6Pm5xBSGw==}
|
|
7280
7280
|
|
|
7281
|
-
prosemirror-history@1.4.
|
|
7282
|
-
resolution: {integrity: sha512-
|
|
7281
|
+
prosemirror-history@1.4.1:
|
|
7282
|
+
resolution: {integrity: sha512-2JZD8z2JviJrboD9cPuX/Sv/1ChFng+xh2tChQ2X4bB2HeK+rra/bmJ3xGntCcjhOqIzSDG6Id7e8RJ9QPXLEQ==}
|
|
7283
7283
|
|
|
7284
7284
|
prosemirror-inputrules@1.4.0:
|
|
7285
7285
|
resolution: {integrity: sha512-6ygpPRuTJ2lcOXs9JkefieMst63wVJBgHZGl5QOytN7oSZs3Co/BYbc3Yx9zm9H37Bxw8kVzCnDsihsVsL4yEg==}
|
|
@@ -7290,11 +7290,11 @@ packages:
|
|
|
7290
7290
|
prosemirror-model@1.21.3:
|
|
7291
7291
|
resolution: {integrity: sha512-nt2Xs/RNGepD9hrrkzXvtCm1mpGJoQfFSPktGa0BF/aav6XsnmVGZ9sTXNWRLupAz5SCLa3EyKlFeK7zJWROKg==}
|
|
7292
7292
|
|
|
7293
|
-
prosemirror-schema-basic@1.2.
|
|
7294
|
-
resolution: {integrity: sha512
|
|
7293
|
+
prosemirror-schema-basic@1.2.3:
|
|
7294
|
+
resolution: {integrity: sha512-h+H0OQwZVqMon1PNn0AG9cTfx513zgIG2DY00eJ00Yvgb3UD+GQ/VlWW5rcaxacpCGT1Yx8nuhwXk4+QbXUfJA==}
|
|
7295
7295
|
|
|
7296
|
-
prosemirror-schema-list@1.4.
|
|
7297
|
-
resolution: {integrity: sha512-
|
|
7296
|
+
prosemirror-schema-list@1.4.1:
|
|
7297
|
+
resolution: {integrity: sha512-jbDyaP/6AFfDfu70VzySsD75Om2t3sXTOdl5+31Wlxlg62td1haUpty/ybajSfJ1pkGadlOfwQq9kgW5IMo1Rg==}
|
|
7298
7298
|
|
|
7299
7299
|
prosemirror-state@1.4.3:
|
|
7300
7300
|
resolution: {integrity: sha512-goFKORVbvPuAQaXhpbemJFRKJ2aixr+AZMGiquiqKxaucC6hlpHNZHWgz5R7dS4roHiwq9vDctE//CZ++o0W1Q==}
|
|
@@ -10718,7 +10718,7 @@ snapshots:
|
|
|
10718
10718
|
'@jridgewell/resolve-uri': 3.1.2
|
|
10719
10719
|
'@jridgewell/sourcemap-codec': 1.4.15
|
|
10720
10720
|
|
|
10721
|
-
'@lblod/ember-rdfa-editor@10.0
|
|
10721
|
+
'@lblod/ember-rdfa-editor@10.4.0(2ef3gpurqxbttnmniw6grhzpuy)':
|
|
10722
10722
|
dependencies:
|
|
10723
10723
|
'@appuniversum/ember-appuniversum': 3.4.2(yenc6o4wruytt4u2jbwlbsqcl4)
|
|
10724
10724
|
'@babel/core': 7.24.7
|
|
@@ -10741,7 +10741,7 @@ snapshots:
|
|
|
10741
10741
|
common-tags: 1.8.2
|
|
10742
10742
|
crypto-browserify: 3.12.0
|
|
10743
10743
|
debug: 4.3.5
|
|
10744
|
-
dompurify: 3.1.
|
|
10744
|
+
dompurify: 3.1.6
|
|
10745
10745
|
ember-auto-import: 2.7.4(@glint/template@1.4.0)(webpack@5.92.1)
|
|
10746
10746
|
ember-changeset: 4.1.2(@glint/template@1.4.0)(webpack@5.92.1)
|
|
10747
10747
|
ember-cli-babel: 8.2.0(@babel/core@7.24.7)
|
|
@@ -10761,14 +10761,14 @@ snapshots:
|
|
|
10761
10761
|
linkifyjs: 4.1.3
|
|
10762
10762
|
mdn-polyfills: 5.20.0
|
|
10763
10763
|
process: 0.11.10
|
|
10764
|
-
prosemirror-commands: 1.
|
|
10764
|
+
prosemirror-commands: 1.6.0
|
|
10765
10765
|
prosemirror-dropcursor: 1.8.1
|
|
10766
|
-
prosemirror-history: 1.4.
|
|
10766
|
+
prosemirror-history: 1.4.1
|
|
10767
10767
|
prosemirror-inputrules: 1.4.0
|
|
10768
10768
|
prosemirror-keymap: 1.2.2
|
|
10769
10769
|
prosemirror-model: 1.21.3
|
|
10770
|
-
prosemirror-schema-basic: 1.2.
|
|
10771
|
-
prosemirror-schema-list: 1.4.
|
|
10770
|
+
prosemirror-schema-basic: 1.2.3
|
|
10771
|
+
prosemirror-schema-list: 1.4.1
|
|
10772
10772
|
prosemirror-state: 1.4.3
|
|
10773
10773
|
prosemirror-transform: 1.9.0
|
|
10774
10774
|
prosemirror-view: 1.33.8
|
|
@@ -12097,7 +12097,7 @@ snapshots:
|
|
|
12097
12097
|
dependencies:
|
|
12098
12098
|
lodash: 4.17.21
|
|
12099
12099
|
|
|
12100
|
-
async@3.2.
|
|
12100
|
+
async@3.2.6: {}
|
|
12101
12101
|
|
|
12102
12102
|
at-least-node@1.0.0: {}
|
|
12103
12103
|
|
|
@@ -13763,7 +13763,7 @@ snapshots:
|
|
|
13763
13763
|
|
|
13764
13764
|
domain-browser@1.2.0: {}
|
|
13765
13765
|
|
|
13766
|
-
dompurify@3.1.
|
|
13766
|
+
dompurify@3.1.6: {}
|
|
13767
13767
|
|
|
13768
13768
|
dot-case@3.0.4:
|
|
13769
13769
|
dependencies:
|
|
@@ -16147,7 +16147,7 @@ snapshots:
|
|
|
16147
16147
|
|
|
16148
16148
|
handlebars-loader@1.7.3(handlebars@4.7.8):
|
|
16149
16149
|
dependencies:
|
|
16150
|
-
async: 3.2.
|
|
16150
|
+
async: 3.2.6
|
|
16151
16151
|
fastparse: 1.1.2
|
|
16152
16152
|
handlebars: 4.7.8
|
|
16153
16153
|
loader-utils: 1.4.2
|
|
@@ -18266,7 +18266,7 @@ snapshots:
|
|
|
18266
18266
|
|
|
18267
18267
|
property-expr@2.0.6: {}
|
|
18268
18268
|
|
|
18269
|
-
prosemirror-commands@1.
|
|
18269
|
+
prosemirror-commands@1.6.0:
|
|
18270
18270
|
dependencies:
|
|
18271
18271
|
prosemirror-model: 1.21.3
|
|
18272
18272
|
prosemirror-state: 1.4.3
|
|
@@ -18306,7 +18306,7 @@ snapshots:
|
|
|
18306
18306
|
prosemirror-transform: 1.9.0
|
|
18307
18307
|
prosemirror-view: 1.33.8
|
|
18308
18308
|
|
|
18309
|
-
prosemirror-history@1.4.
|
|
18309
|
+
prosemirror-history@1.4.1:
|
|
18310
18310
|
dependencies:
|
|
18311
18311
|
prosemirror-state: 1.4.3
|
|
18312
18312
|
prosemirror-transform: 1.9.0
|
|
@@ -18327,11 +18327,11 @@ snapshots:
|
|
|
18327
18327
|
dependencies:
|
|
18328
18328
|
orderedmap: 2.1.1
|
|
18329
18329
|
|
|
18330
|
-
prosemirror-schema-basic@1.2.
|
|
18330
|
+
prosemirror-schema-basic@1.2.3:
|
|
18331
18331
|
dependencies:
|
|
18332
18332
|
prosemirror-model: 1.21.3
|
|
18333
18333
|
|
|
18334
|
-
prosemirror-schema-list@1.4.
|
|
18334
|
+
prosemirror-schema-list@1.4.1:
|
|
18335
18335
|
dependencies:
|
|
18336
18336
|
prosemirror-model: 1.21.3
|
|
18337
18337
|
prosemirror-state: 1.4.3
|
package/translations/en-US.yaml
CHANGED
package/translations/nl-BE.yaml
CHANGED