@ulb-darmstadt/shacl-form 1.1.5 → 1.1.7

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.
@@ -1,3 +1,11 @@
1
+ /*!
2
+ * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
3
+ */
4
+
5
+ /*!
6
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
7
+ */
8
+
1
9
  /*!
2
10
  * The buffer module from node.js, for the browser.
3
11
  *
@@ -10,3 +18,54 @@
10
18
  /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
11
19
 
12
20
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
21
+
22
+ /**
23
+ * A JavaScript implementation of the JSON-LD API.
24
+ *
25
+ * @author Dave Longley
26
+ *
27
+ * @license BSD 3-Clause License
28
+ * Copyright (c) 2011-2022 Digital Bazaar, Inc.
29
+ * All rights reserved.
30
+ *
31
+ * Redistribution and use in source and binary forms, with or without
32
+ * modification, are permitted provided that the following conditions are met:
33
+ *
34
+ * Redistributions of source code must retain the above copyright notice,
35
+ * this list of conditions and the following disclaimer.
36
+ *
37
+ * Redistributions in binary form must reproduce the above copyright
38
+ * notice, this list of conditions and the following disclaimer in the
39
+ * documentation and/or other materials provided with the distribution.
40
+ *
41
+ * Neither the name of the Digital Bazaar, Inc. nor the names of its
42
+ * contributors may be used to endorse or promote products derived from
43
+ * this software without specific prior written permission.
44
+ *
45
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
46
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
47
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
48
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
49
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
51
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
52
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
53
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
54
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
55
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56
+ */
57
+
58
+ /**
59
+ * Removes the @preserve keywords from expanded result of framing.
60
+ *
61
+ * @param input the framed, framed output.
62
+ * @param options the framing options used.
63
+ *
64
+ * @return the resulting output.
65
+ */
66
+
67
+ // disallow aliasing @context and @preserve
68
+
69
+ // remove @preserve
70
+
71
+ // remove @preserve from results
package/dist/plugin.d.ts CHANGED
@@ -1,11 +1,18 @@
1
1
  import { ShaclPropertyTemplate } from './property-template';
2
2
  import { Term } from '@rdfjs/types';
3
- export type Plugins = {
4
- [predicate: string]: Plugin;
3
+ export declare class Plugins {
4
+ private plugins;
5
+ register(plugin: Plugin): void;
6
+ find(predicate: string | undefined, datatype: string | undefined): Plugin | undefined;
7
+ }
8
+ export type PluginOptions = {
9
+ predicate?: string;
10
+ datatype?: string;
5
11
  };
6
12
  export declare abstract class Plugin {
7
- predicate: string;
8
- constructor(predicate: string);
13
+ predicate: string | undefined;
14
+ datatype: string | undefined;
15
+ constructor(options: PluginOptions);
9
16
  abstract createInstance(template: ShaclPropertyTemplate, value?: Term): HTMLElement;
10
17
  }
11
18
  export type ClassInstanceProvider = (clazz: string) => Promise<string>;
@@ -1,9 +1,9 @@
1
- import { Plugin } from '../plugin';
1
+ import { Plugin, PluginOptions } from '../plugin';
2
2
  import { Term } from '@rdfjs/types';
3
3
  import { ShaclPropertyTemplate } from '../property-template';
4
4
  import { InputListEntry } from '../editors';
5
5
  export declare class FixedListPlugin extends Plugin {
6
6
  entries: InputListEntry[];
7
- constructor(predicate: string, entries: InputListEntry[]);
7
+ constructor(options: PluginOptions, entries: InputListEntry[]);
8
8
  createInstance(template: ShaclPropertyTemplate, value?: Term): HTMLElement;
9
9
  }
@@ -1,15 +1,26 @@
1
1
  import { Term } from '@rdfjs/types';
2
- import { Plugin } from '../plugin';
2
+ import { Plugin, PluginOptions } from '../plugin';
3
3
  import { ShaclPropertyTemplate } from '../property-template';
4
4
  import { Editor } from '../editors';
5
5
  import mapboxgl from 'mapbox-gl';
6
+ import MapboxDraw from '@mapbox/mapbox-gl-draw';
6
7
  import 'mapbox-gl/dist/mapbox-gl.css';
8
+ import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
7
9
  export declare class MapBoxPlugin extends Plugin {
8
10
  map: mapboxgl.Map;
9
11
  dialog: HTMLDialogElement;
10
12
  currentEditor: Editor | undefined;
11
13
  currentMarker: mapboxgl.Marker | undefined;
12
- constructor(predicate: string, apiKey: string);
14
+ draw: MapboxDraw;
15
+ constructor(options: PluginOptions, apiKey: string);
13
16
  createInstance(template: ShaclPropertyTemplate, value?: Term): HTMLElement;
14
- setMarker(pos: mapboxgl.LngLat | undefined): void;
17
+ deleteAllButLastDrawing(): void;
18
+ getEditorValue(): {
19
+ type: string;
20
+ coordinates: number[];
21
+ } | {
22
+ type: string;
23
+ coordinates: number[][][];
24
+ } | undefined;
25
+ setEditorValue(): void;
15
26
  }
package/dist/util.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Prefixes, Quad, Store } from 'n3';
1
+ import { NamedNode, Prefixes, Quad, Store } from 'n3';
2
2
  import { Term } from '@rdfjs/types';
3
3
  import { InputListEntry } from './editors';
4
4
  import { Config } from './config';
@@ -8,4 +8,4 @@ export declare function focusFirstInputElement(context: HTMLElement): void;
8
8
  export declare function findLabel(quads: Quad[], language?: string | null): string;
9
9
  export declare function createInputListEntries(subjects: Term[], shapesGraph: Store, language?: string | null): InputListEntry[];
10
10
  export declare function removePrefixes(id: string, prefixes: Prefixes): string;
11
- export declare function findInstancesOf(clazz: Term, config: Config): InputListEntry[];
11
+ export declare function findInstancesOf(clazz: NamedNode, config: Config): InputListEntry[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulb-darmstadt/shacl-form",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "SHACL form generator",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -44,6 +44,8 @@
44
44
  "webpack-dev-server": "^4.15.1"
45
45
  },
46
46
  "dependencies": {
47
+ "@mapbox/mapbox-gl-draw": "^1.4.2",
48
+ "jsonld": "^8.3.1",
47
49
  "mapbox-gl": "^2.15.0",
48
50
  "n3": "^1.17.0",
49
51
  "rdf-validate-shacl": "^0.4.5",