@ldo/solid-react 0.0.1-alpha.14
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/README.md +13 -0
- package/dist/BrowserSolidLdoProvider.d.ts +2 -0
- package/dist/BrowserSolidLdoProvider.js +58 -0
- package/dist/BrowserSolidLdoProvider.js.map +1 -0
- package/dist/LdoContext.d.ts +9 -0
- package/dist/LdoContext.js +9 -0
- package/dist/LdoContext.js.map +1 -0
- package/dist/LdoProvider.d.ts +9 -0
- package/dist/LdoProvider.js +45 -0
- package/dist/LdoProvider.js.map +1 -0
- package/dist/SolidAuthContext.d.ts +14 -0
- package/dist/SolidAuthContext.js +10 -0
- package/dist/SolidAuthContext.js.map +1 -0
- package/dist/SolidAuthProvider.d.ts +17 -0
- package/dist/SolidAuthProvider.js +56 -0
- package/dist/SolidAuthProvider.js.map +1 -0
- package/dist/SolidLdoProvider.d.ts +8 -0
- package/dist/SolidLdoProvider.js +31 -0
- package/dist/SolidLdoProvider.js.map +1 -0
- package/dist/document/DocumentStore.d.ts +11 -0
- package/dist/document/DocumentStore.js +24 -0
- package/dist/document/DocumentStore.js.map +1 -0
- package/dist/document/FetchableDocument.d.ts +28 -0
- package/dist/document/FetchableDocument.js +75 -0
- package/dist/document/FetchableDocument.js.map +1 -0
- package/dist/document/accessRules/AccessRules.d.ts +19 -0
- package/dist/document/accessRules/AccessRules.js +53 -0
- package/dist/document/accessRules/AccessRules.js.map +1 -0
- package/dist/document/accessRules/AccessRulesStore.d.ts +10 -0
- package/dist/document/accessRules/AccessRulesStore.js +12 -0
- package/dist/document/accessRules/AccessRulesStore.js.map +1 -0
- package/dist/document/errors/DocumentError.d.ts +5 -0
- package/dist/document/errors/DocumentError.js +11 -0
- package/dist/document/errors/DocumentError.js.map +1 -0
- package/dist/document/errors/DocumentFetchError.d.ts +6 -0
- package/dist/document/errors/DocumentFetchError.js +12 -0
- package/dist/document/errors/DocumentFetchError.js.map +1 -0
- package/dist/document/resource/Resource.d.ts +23 -0
- package/dist/document/resource/Resource.js +48 -0
- package/dist/document/resource/Resource.js.map +1 -0
- package/dist/document/resource/binaryResource/BinaryResource.d.ts +7 -0
- package/dist/document/resource/binaryResource/BinaryResource.js +11 -0
- package/dist/document/resource/binaryResource/BinaryResource.js.map +1 -0
- package/dist/document/resource/binaryResource/BinaryResourceStore.d.ts +10 -0
- package/dist/document/resource/binaryResource/BinaryResourceStore.js +15 -0
- package/dist/document/resource/binaryResource/BinaryResourceStore.js.map +1 -0
- package/dist/document/resource/dataResource/DataResource.d.ts +20 -0
- package/dist/document/resource/dataResource/DataResource.js +81 -0
- package/dist/document/resource/dataResource/DataResource.js.map +1 -0
- package/dist/document/resource/dataResource/DataResourceStore.d.ts +10 -0
- package/dist/document/resource/dataResource/DataResourceStore.js +15 -0
- package/dist/document/resource/dataResource/DataResourceStore.js.map +1 -0
- package/dist/document/resource/dataResource/containerResource/ContainerResource.d.ts +20 -0
- package/dist/document/resource/dataResource/containerResource/ContainerResource.js +74 -0
- package/dist/document/resource/dataResource/containerResource/ContainerResource.js.map +1 -0
- package/dist/document/resource/dataResource/containerResource/ContainerResourceStore.d.ts +13 -0
- package/dist/document/resource/dataResource/containerResource/ContainerResourceStore.js +33 -0
- package/dist/document/resource/dataResource/containerResource/ContainerResourceStore.js.map +1 -0
- package/dist/documentHooks/useAccessRules.d.ts +3 -0
- package/dist/documentHooks/useAccessRules.js +16 -0
- package/dist/documentHooks/useAccessRules.js.map +1 -0
- package/dist/documentHooks/useBinaryResource.d.ts +2 -0
- package/dist/documentHooks/useBinaryResource.js +16 -0
- package/dist/documentHooks/useBinaryResource.js.map +1 -0
- package/dist/documentHooks/useContainerResource.d.ts +2 -0
- package/dist/documentHooks/useContainerResource.js +16 -0
- package/dist/documentHooks/useContainerResource.js.map +1 -0
- package/dist/documentHooks/useDataResource.d.ts +2 -0
- package/dist/documentHooks/useDataResource.js +16 -0
- package/dist/documentHooks/useDataResource.js.map +1 -0
- package/dist/documentHooks/useDocument.d.ts +5 -0
- package/dist/documentHooks/useDocument.js +20 -0
- package/dist/documentHooks/useDocument.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/ldo/solid.context.d.ts +2 -0
- package/dist/ldo/solid.context.js +33 -0
- package/dist/ldo/solid.context.js.map +1 -0
- package/dist/ldo/solid.schema.d.ts +2 -0
- package/dist/ldo/solid.schema.js +211 -0
- package/dist/ldo/solid.schema.js.map +1 -0
- package/dist/ldo/solid.shapeTypes.d.ts +4 -0
- package/dist/ldo/solid.shapeTypes.js +16 -0
- package/dist/ldo/solid.shapeTypes.js.map +1 -0
- package/dist/ldo/solid.typings.d.ts +26 -0
- package/dist/ldo/solid.typings.js +3 -0
- package/dist/ldo/solid.typings.js.map +1 -0
- package/dist/ldoHooks/helpers/TrackingProxyContext.d.ts +10 -0
- package/dist/ldoHooks/helpers/TrackingProxyContext.js +68 -0
- package/dist/ldoHooks/helpers/TrackingProxyContext.js.map +1 -0
- package/dist/ldoHooks/helpers/UpdateManager.d.ts +12 -0
- package/dist/ldoHooks/helpers/UpdateManager.js +64 -0
- package/dist/ldoHooks/helpers/UpdateManager.js.map +1 -0
- package/dist/ldoHooks/useMatchingObjects.d.ts +0 -0
- package/dist/ldoHooks/useMatchingObjects.js +2 -0
- package/dist/ldoHooks/useMatchingObjects.js.map +1 -0
- package/dist/ldoHooks/useMatchingSubjects.d.ts +0 -0
- package/dist/ldoHooks/useMatchingSubjects.js +2 -0
- package/dist/ldoHooks/useMatchingSubjects.js.map +1 -0
- package/dist/ldoHooks/useSubject.d.ts +3 -0
- package/dist/ldoHooks/useSubject.js +38 -0
- package/dist/ldoHooks/useSubject.js.map +1 -0
- package/dist/old/LdoContext.d.ts +9 -0
- package/dist/old/LdoContext.js +9 -0
- package/dist/old/LdoContext.js.map +1 -0
- package/dist/old/LdoProvider.d.ts +9 -0
- package/dist/old/LdoProvider.js +41 -0
- package/dist/old/LdoProvider.js.map +1 -0
- package/dist/old/SolidAuthProvider.d.ts +3 -0
- package/dist/old/SolidAuthProvider.js +56 -0
- package/dist/old/SolidAuthProvider.js.map +1 -0
- package/dist/old/documentHooks/useAccessRules.d.ts +3 -0
- package/dist/old/documentHooks/useAccessRules.js +17 -0
- package/dist/old/documentHooks/useAccessRules.js.map +1 -0
- package/dist/old/documentHooks/useBinaryResource.d.ts +2 -0
- package/dist/old/documentHooks/useBinaryResource.js +11 -0
- package/dist/old/documentHooks/useBinaryResource.js.map +1 -0
- package/dist/old/documentHooks/useContainerResource.d.ts +2 -0
- package/dist/old/documentHooks/useContainerResource.js +11 -0
- package/dist/old/documentHooks/useContainerResource.js.map +1 -0
- package/dist/old/documentHooks/useDataResource.d.ts +2 -0
- package/dist/old/documentHooks/useDataResource.js +11 -0
- package/dist/old/documentHooks/useDataResource.js.map +1 -0
- package/dist/old/documentHooks/useDocument.d.ts +6 -0
- package/dist/old/documentHooks/useDocument.js +24 -0
- package/dist/old/documentHooks/useDocument.js.map +1 -0
- package/dist/old/ldoHooks/helpers/TrackingProxyContext.d.ts +10 -0
- package/dist/old/ldoHooks/helpers/TrackingProxyContext.js +68 -0
- package/dist/old/ldoHooks/helpers/TrackingProxyContext.js.map +1 -0
- package/dist/old/ldoHooks/helpers/UpdateManager.d.ts +9 -0
- package/dist/old/ldoHooks/helpers/UpdateManager.js +61 -0
- package/dist/old/ldoHooks/helpers/UpdateManager.js.map +1 -0
- package/dist/old/ldoHooks/useMatchingObjects.d.ts +0 -0
- package/dist/old/ldoHooks/useMatchingObjects.js +2 -0
- package/dist/old/ldoHooks/useMatchingObjects.js.map +1 -0
- package/dist/old/ldoHooks/useMatchingSubjects.d.ts +0 -0
- package/dist/old/ldoHooks/useMatchingSubjects.js +2 -0
- package/dist/old/ldoHooks/useMatchingSubjects.js.map +1 -0
- package/dist/old/ldoHooks/useSubject.d.ts +3 -0
- package/dist/old/ldoHooks/useSubject.js +38 -0
- package/dist/old/ldoHooks/useSubject.js.map +1 -0
- package/dist/old/useLdo.d.ts +18 -0
- package/dist/old/useLdo.js +46 -0
- package/dist/old/useLdo.js.map +1 -0
- package/dist/useLdo.d.ts +18 -0
- package/dist/useLdo.js +46 -0
- package/dist/useLdo.js.map +1 -0
- package/dist/useLdoMethods.d.ts +12 -0
- package/dist/useLdoMethods.js +34 -0
- package/dist/useLdoMethods.js.map +1 -0
- package/dist/useResource.d.ts +11 -0
- package/dist/useResource.js +48 -0
- package/dist/useResource.js.map +1 -0
- package/dist/useRootContainer.d.ts +2 -0
- package/dist/useRootContainer.js +23 -0
- package/dist/useRootContainer.js.map +1 -0
- package/dist/useSubject.d.ts +5 -0
- package/dist/useSubject.js +36 -0
- package/dist/useSubject.js.map +1 -0
- package/dist/util/TrackingProxyContext.d.ts +15 -0
- package/dist/util/TrackingProxyContext.js +74 -0
- package/dist/util/TrackingProxyContext.js.map +1 -0
- package/dist/util/changesToSparqlUpdate.d.ts +3 -0
- package/dist/util/changesToSparqlUpdate.js +26 -0
- package/dist/util/changesToSparqlUpdate.js.map +1 -0
- package/dist/util/createGlobalHook.d.ts +6 -0
- package/dist/util/createGlobalHook.js +18 -0
- package/dist/util/createGlobalHook.js.map +1 -0
- package/dist/util/createWrapperProxy.d.ts +2 -0
- package/dist/util/createWrapperProxy.js +8 -0
- package/dist/util/createWrapperProxy.js.map +1 -0
- package/dist/util/splitChangesByGraph.d.ts +6 -0
- package/dist/util/splitChangesByGraph.js +45 -0
- package/dist/util/splitChangesByGraph.js.map +1 -0
- package/dist/util/useForceReload.d.ts +1 -0
- package/dist/util/useForceReload.js +10 -0
- package/dist/util/useForceReload.js.map +1 -0
- package/package.json +51 -0
- package/src/BrowserSolidLdoProvider.tsx +91 -0
- package/src/SolidAuthContext.ts +26 -0
- package/src/SolidLdoProvider.tsx +55 -0
- package/src/index.ts +9 -0
- package/src/useLdoMethods.ts +92 -0
- package/src/useResource.ts +97 -0
- package/src/useRootContainer.ts +24 -0
- package/src/useSubject.ts +67 -0
- package/src/util/TrackingProxyContext.ts +99 -0
- package/src/util/createWrapperProxy.ts +7 -0
- package/src/util/useForceReload.ts +6 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.solidContext = void 0;
|
|
4
|
+
exports.solidContext = {
|
|
5
|
+
type: {
|
|
6
|
+
"@id": "@type",
|
|
7
|
+
"@container": "@set",
|
|
8
|
+
},
|
|
9
|
+
Container: "http://www.w3.org/ns/ldp#Container",
|
|
10
|
+
Resource: "http://www.w3.org/ns/ldp#Resource",
|
|
11
|
+
modified: {
|
|
12
|
+
"@id": "http://purl.org/dc/terms/modified",
|
|
13
|
+
"@type": "http://www.w3.org/2001/XMLSchema#string",
|
|
14
|
+
"@container": "@set",
|
|
15
|
+
},
|
|
16
|
+
contains: {
|
|
17
|
+
"@id": "http://www.w3.org/ns/ldp#contains",
|
|
18
|
+
"@type": "@id",
|
|
19
|
+
"@container": "@set",
|
|
20
|
+
},
|
|
21
|
+
Resource2: "http://www.w3.org/ns/iana/media-types/text/turtle#Resource",
|
|
22
|
+
mtime: {
|
|
23
|
+
"@id": "http://www.w3.org/ns/posix/stat#mtime",
|
|
24
|
+
"@type": "http://www.w3.org/2001/XMLSchema#decimal",
|
|
25
|
+
"@container": "@set",
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
"@id": "http://www.w3.org/ns/posix/stat#size",
|
|
29
|
+
"@type": "http://www.w3.org/2001/XMLSchema#integer",
|
|
30
|
+
"@container": "@set",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=solid.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid.context.js","sourceRoot":"","sources":["../../src/ldo/solid.context.ts"],"names":[],"mappings":";;;AAOa,QAAA,YAAY,GAAsB;IAC7C,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,YAAY,EAAE,MAAM;KACrB;IACD,SAAS,EAAE,oCAAoC;IAC/C,QAAQ,EAAE,mCAAmC;IAC7C,QAAQ,EAAE;QACR,KAAK,EAAE,mCAAmC;QAC1C,OAAO,EAAE,yCAAyC;QAClD,YAAY,EAAE,MAAM;KACrB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,mCAAmC;QAC1C,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,MAAM;KACrB;IACD,SAAS,EAAE,4DAA4D;IACvE,KAAK,EAAE;QACL,KAAK,EAAE,uCAAuC;QAC9C,OAAO,EAAE,0CAA0C;QACnD,YAAY,EAAE,MAAM;KACrB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,sCAAsC;QAC7C,OAAO,EAAE,0CAA0C;QACnD,YAAY,EAAE,MAAM;KACrB;CACF,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.solidSchema = void 0;
|
|
4
|
+
exports.solidSchema = {
|
|
5
|
+
type: "Schema",
|
|
6
|
+
shapes: [
|
|
7
|
+
{
|
|
8
|
+
id: "http://www.w3.org/ns/lddps#Container",
|
|
9
|
+
type: "ShapeDecl",
|
|
10
|
+
shapeExpr: {
|
|
11
|
+
type: "Shape",
|
|
12
|
+
expression: {
|
|
13
|
+
id: "http://www.w3.org/ns/lddps#ContainerShape",
|
|
14
|
+
type: "EachOf",
|
|
15
|
+
expressions: [
|
|
16
|
+
{
|
|
17
|
+
type: "TripleConstraint",
|
|
18
|
+
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
19
|
+
valueExpr: {
|
|
20
|
+
type: "NodeConstraint",
|
|
21
|
+
values: [
|
|
22
|
+
"http://www.w3.org/ns/ldp#Container",
|
|
23
|
+
"http://www.w3.org/ns/ldp#Resource",
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
min: 0,
|
|
27
|
+
max: -1,
|
|
28
|
+
annotations: [
|
|
29
|
+
{
|
|
30
|
+
type: "Annotation",
|
|
31
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
32
|
+
object: {
|
|
33
|
+
value: "A container on a Solid server",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "TripleConstraint",
|
|
40
|
+
predicate: "http://purl.org/dc/terms/modified",
|
|
41
|
+
valueExpr: {
|
|
42
|
+
type: "NodeConstraint",
|
|
43
|
+
datatype: "http://www.w3.org/2001/XMLSchema#string",
|
|
44
|
+
},
|
|
45
|
+
min: 0,
|
|
46
|
+
max: 1,
|
|
47
|
+
annotations: [
|
|
48
|
+
{
|
|
49
|
+
type: "Annotation",
|
|
50
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
51
|
+
object: {
|
|
52
|
+
value: "Date modified",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "TripleConstraint",
|
|
59
|
+
predicate: "http://www.w3.org/ns/ldp#contains",
|
|
60
|
+
valueExpr: "http://www.w3.org/ns/lddps#Resource",
|
|
61
|
+
min: 0,
|
|
62
|
+
max: -1,
|
|
63
|
+
annotations: [
|
|
64
|
+
{
|
|
65
|
+
type: "Annotation",
|
|
66
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
67
|
+
object: {
|
|
68
|
+
value: "Defines a Solid Resource",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: "TripleConstraint",
|
|
75
|
+
predicate: "http://www.w3.org/ns/posix/stat#mtime",
|
|
76
|
+
valueExpr: {
|
|
77
|
+
type: "NodeConstraint",
|
|
78
|
+
datatype: "http://www.w3.org/2001/XMLSchema#decimal",
|
|
79
|
+
},
|
|
80
|
+
min: 0,
|
|
81
|
+
max: 1,
|
|
82
|
+
annotations: [
|
|
83
|
+
{
|
|
84
|
+
type: "Annotation",
|
|
85
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
86
|
+
object: {
|
|
87
|
+
value: "?",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "TripleConstraint",
|
|
94
|
+
predicate: "http://www.w3.org/ns/posix/stat#size",
|
|
95
|
+
valueExpr: {
|
|
96
|
+
type: "NodeConstraint",
|
|
97
|
+
datatype: "http://www.w3.org/2001/XMLSchema#integer",
|
|
98
|
+
},
|
|
99
|
+
min: 0,
|
|
100
|
+
max: 1,
|
|
101
|
+
annotations: [
|
|
102
|
+
{
|
|
103
|
+
type: "Annotation",
|
|
104
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
105
|
+
object: {
|
|
106
|
+
value: "size of this container",
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "http://www.w3.org/ns/lddps#Resource",
|
|
118
|
+
type: "ShapeDecl",
|
|
119
|
+
shapeExpr: {
|
|
120
|
+
type: "Shape",
|
|
121
|
+
expression: {
|
|
122
|
+
id: "http://www.w3.org/ns/lddps#ResourceShape",
|
|
123
|
+
type: "EachOf",
|
|
124
|
+
expressions: [
|
|
125
|
+
{
|
|
126
|
+
type: "TripleConstraint",
|
|
127
|
+
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
128
|
+
valueExpr: {
|
|
129
|
+
type: "NodeConstraint",
|
|
130
|
+
values: [
|
|
131
|
+
"http://www.w3.org/ns/ldp#Resource",
|
|
132
|
+
"http://www.w3.org/ns/iana/media-types/text/turtle#Resource",
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
min: 0,
|
|
136
|
+
max: -1,
|
|
137
|
+
annotations: [
|
|
138
|
+
{
|
|
139
|
+
type: "Annotation",
|
|
140
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
141
|
+
object: {
|
|
142
|
+
value: "Any resource on a Solid server",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: "TripleConstraint",
|
|
149
|
+
predicate: "http://purl.org/dc/terms/modified",
|
|
150
|
+
valueExpr: {
|
|
151
|
+
type: "NodeConstraint",
|
|
152
|
+
datatype: "http://www.w3.org/2001/XMLSchema#string",
|
|
153
|
+
},
|
|
154
|
+
min: 0,
|
|
155
|
+
max: 1,
|
|
156
|
+
annotations: [
|
|
157
|
+
{
|
|
158
|
+
type: "Annotation",
|
|
159
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
160
|
+
object: {
|
|
161
|
+
value: "Date modified",
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
type: "TripleConstraint",
|
|
168
|
+
predicate: "http://www.w3.org/ns/posix/stat#mtime",
|
|
169
|
+
valueExpr: {
|
|
170
|
+
type: "NodeConstraint",
|
|
171
|
+
datatype: "http://www.w3.org/2001/XMLSchema#decimal",
|
|
172
|
+
},
|
|
173
|
+
min: 0,
|
|
174
|
+
max: 1,
|
|
175
|
+
annotations: [
|
|
176
|
+
{
|
|
177
|
+
type: "Annotation",
|
|
178
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
179
|
+
object: {
|
|
180
|
+
value: "?",
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: "TripleConstraint",
|
|
187
|
+
predicate: "http://www.w3.org/ns/posix/stat#size",
|
|
188
|
+
valueExpr: {
|
|
189
|
+
type: "NodeConstraint",
|
|
190
|
+
datatype: "http://www.w3.org/2001/XMLSchema#integer",
|
|
191
|
+
},
|
|
192
|
+
min: 0,
|
|
193
|
+
max: 1,
|
|
194
|
+
annotations: [
|
|
195
|
+
{
|
|
196
|
+
type: "Annotation",
|
|
197
|
+
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
198
|
+
object: {
|
|
199
|
+
value: "size of this container",
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=solid.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid.schema.js","sourceRoot":"","sources":["../../src/ldo/solid.schema.ts"],"names":[],"mappings":";;;AAOa,QAAA,WAAW,GAAW;IACjC,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE;QACN;YACE,EAAE,EAAE,sCAAsC;YAC1C,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE;oBACV,EAAE,EAAE,2CAA2C;oBAC/C,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACX;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,iDAAiD;4BAC5D,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,MAAM,EAAE;oCACN,oCAAoC;oCACpC,mCAAmC;iCACpC;6BACF;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EAAE,+BAA+B;qCACvC;iC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,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EAAE,GAAG;qCACX;iCACF;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,sCAAsC;4BACjD,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,0CAA0C;6BACrD;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC;4BACN,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EAAE,wBAAwB;qCAChC;iCACF;6BACF;yBACF;qBACF;iBACF;gBACD,KAAK,EAAE,CAAC,iDAAiD,CAAC;aAC3D;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceShapeType = exports.ContainerShapeType = void 0;
|
|
4
|
+
const solid_schema_1 = require("./solid.schema");
|
|
5
|
+
const solid_context_1 = require("./solid.context");
|
|
6
|
+
exports.ContainerShapeType = {
|
|
7
|
+
schema: solid_schema_1.solidSchema,
|
|
8
|
+
shape: "http://www.w3.org/ns/lddps#Container",
|
|
9
|
+
context: solid_context_1.solidContext,
|
|
10
|
+
};
|
|
11
|
+
exports.ResourceShapeType = {
|
|
12
|
+
schema: solid_schema_1.solidSchema,
|
|
13
|
+
shape: "http://www.w3.org/ns/lddps#Resource",
|
|
14
|
+
context: solid_context_1.solidContext,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=solid.shapeTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid.shapeTypes.js","sourceRoot":"","sources":["../../src/ldo/solid.shapeTypes.ts"],"names":[],"mappings":";;;AACA,iDAA6C;AAC7C,mDAA+C;AAYlC,QAAA,kBAAkB,GAAyB;IACtD,MAAM,EAAE,0BAAW;IACnB,KAAK,EAAE,sCAAsC;IAC7C,OAAO,EAAE,4BAAY;CACtB,CAAC;AAKW,QAAA,iBAAiB,GAAwB;IACpD,MAAM,EAAE,0BAAW;IACnB,KAAK,EAAE,qCAAqC;IAC5C,OAAO,EAAE,4BAAY;CACtB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ContextDefinition } from "jsonld";
|
|
2
|
+
export interface Container {
|
|
3
|
+
"@id"?: string;
|
|
4
|
+
"@context"?: ContextDefinition;
|
|
5
|
+
type?: ({
|
|
6
|
+
"@id": "Container";
|
|
7
|
+
} | {
|
|
8
|
+
"@id": "Resource";
|
|
9
|
+
})[];
|
|
10
|
+
modified?: string;
|
|
11
|
+
contains?: Resource[];
|
|
12
|
+
mtime?: number;
|
|
13
|
+
size?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface Resource {
|
|
16
|
+
"@id"?: string;
|
|
17
|
+
"@context"?: ContextDefinition;
|
|
18
|
+
type?: ({
|
|
19
|
+
"@id": "Resource";
|
|
20
|
+
} | {
|
|
21
|
+
"@id": "Resource2";
|
|
22
|
+
})[];
|
|
23
|
+
modified?: string;
|
|
24
|
+
mtime?: number;
|
|
25
|
+
size?: number;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid.typings.js","sourceRoot":"","sources":["../../src/ldo/solid.typings.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ArrayProxyTarget, SubjectProxyTarget, ProxyContextOptions } from "@ldo/jsonld-dataset-proxy";
|
|
2
|
+
import { ProxyContext } from "@ldo/jsonld-dataset-proxy";
|
|
3
|
+
import type { UpdateManager } from "./UpdateManager";
|
|
4
|
+
export declare class TrackingProxyContext extends ProxyContext {
|
|
5
|
+
private updateManager;
|
|
6
|
+
private listener;
|
|
7
|
+
constructor(options: ProxyContextOptions, updateManager: UpdateManager, listener: () => void);
|
|
8
|
+
protected createSubjectHandler(): ProxyHandler<SubjectProxyTarget>;
|
|
9
|
+
protected createArrayHandler(): ProxyHandler<ArrayProxyTarget>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TrackingProxyContext = void 0;
|
|
4
|
+
const jsonld_dataset_proxy_1 = require("@ldo/jsonld-dataset-proxy");
|
|
5
|
+
const data_model_1 = require("@rdfjs/data-model");
|
|
6
|
+
class TrackingProxyContext extends jsonld_dataset_proxy_1.ProxyContext {
|
|
7
|
+
constructor(options, updateManager, listener) {
|
|
8
|
+
super(options);
|
|
9
|
+
this.updateManager = updateManager;
|
|
10
|
+
this.listener = listener;
|
|
11
|
+
}
|
|
12
|
+
createSubjectHandler() {
|
|
13
|
+
const baseHandler = super.createSubjectHandler();
|
|
14
|
+
const oldGetFunction = baseHandler.get;
|
|
15
|
+
const newGetFunction = (target, key, receiver) => {
|
|
16
|
+
const subject = target["@id"];
|
|
17
|
+
if (typeof key === "symbol") {
|
|
18
|
+
}
|
|
19
|
+
else if (key === "@id") {
|
|
20
|
+
this.updateManager.registerListener([subject, null, null], this.listener);
|
|
21
|
+
}
|
|
22
|
+
else if (!this.contextUtil.isArray(key)) {
|
|
23
|
+
const predicate = (0, data_model_1.namedNode)(this.contextUtil.keyToIri(key));
|
|
24
|
+
this.updateManager.registerListener([subject, predicate, null], this.listener);
|
|
25
|
+
}
|
|
26
|
+
return oldGetFunction && oldGetFunction(target, key, receiver);
|
|
27
|
+
};
|
|
28
|
+
baseHandler.get = newGetFunction;
|
|
29
|
+
baseHandler.set = () => {
|
|
30
|
+
console.warn("You've attempted to set a value on a Linked Data Object from the useSubject, useMatchingSubject, or useMatchingObject hooks. These linked data objects should only be used to render data, not modify it. To modify data, use the `changeData` function.");
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
return baseHandler;
|
|
34
|
+
}
|
|
35
|
+
createArrayHandler() {
|
|
36
|
+
const baseHandler = super.createArrayHandler();
|
|
37
|
+
const oldGetFunction = baseHandler.get;
|
|
38
|
+
const newGetFunction = (target, key, receiver) => {
|
|
39
|
+
if (qualifiedArrayMethods.has(key)) {
|
|
40
|
+
this.updateManager.registerListener([target[0][0], target[0][1], target[0][2]], this.listener);
|
|
41
|
+
}
|
|
42
|
+
return oldGetFunction && oldGetFunction(target, key, receiver);
|
|
43
|
+
};
|
|
44
|
+
baseHandler.get = newGetFunction;
|
|
45
|
+
return baseHandler;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.TrackingProxyContext = TrackingProxyContext;
|
|
49
|
+
const qualifiedArrayMethods = new Set([
|
|
50
|
+
"forEach",
|
|
51
|
+
"map",
|
|
52
|
+
"reduce",
|
|
53
|
+
Symbol.iterator,
|
|
54
|
+
"entries",
|
|
55
|
+
"every",
|
|
56
|
+
"filter",
|
|
57
|
+
"find",
|
|
58
|
+
"findIndex",
|
|
59
|
+
"findLast",
|
|
60
|
+
"findLastIndex",
|
|
61
|
+
"includes, indexOf",
|
|
62
|
+
"keys",
|
|
63
|
+
"lastIndexOf",
|
|
64
|
+
"reduceRight",
|
|
65
|
+
"some",
|
|
66
|
+
"values",
|
|
67
|
+
]);
|
|
68
|
+
//# sourceMappingURL=TrackingProxyContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackingProxyContext.js","sourceRoot":"","sources":["../../../src/ldoHooks/helpers/TrackingProxyContext.ts"],"names":[],"mappings":";;;AAKA,oEAAyD;AAEzD,kDAA8C;AAE9C,MAAa,oBAAqB,SAAQ,mCAAY;IAIpD,YACE,OAA4B,EAC5B,aAA4B,EAC5B,QAAoB;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAA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,CAAC;QACvC,MAAM,cAAc,GAA0C,CAC5D,MAAwB,EACxB,GAAoB,EACpB,QAAQ,EACR,EAAE;YACF,IAAI,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAClC,IAAI,CAAC,aAAa,CAAC,gBAAgB,CACjC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1C,IAAI,CAAC,QAAQ,CACd,CAAC;aACH;YACD,OAAO,cAAc,IAAI,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QACjE,CAAC,CAAC;QACF,WAAW,CAAC,GAAG,GAAG,cAAc,CAAC;QACjC,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AApED,oDAoEC;AAED,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,SAAS;IACT,KAAK;IACL,QAAQ;IACR,MAAM,CAAC,QAAQ;IACf,SAAS;IACT,OAAO;IACP,QAAQ;IACR,MAAM;IACN,WAAW;IACX,UAAU;IACV,eAAe;IACf,mBAAmB;IACnB,MAAM;IACN,aAAa;IACb,aAAa;IACb,MAAM;IACN,QAAQ;CACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DatasetChanges } from "@ldo/subscribable-dataset";
|
|
2
|
+
import type { QuadMatch } from "@ldo/jsonld-dataset-proxy";
|
|
3
|
+
import type { Quad } from "@rdfjs/types";
|
|
4
|
+
export type TripleMatch = [QuadMatch[0], QuadMatch[1], QuadMatch[2]];
|
|
5
|
+
export declare class UpdateManager {
|
|
6
|
+
private tripleMatchListenerMap;
|
|
7
|
+
private listenerHashMap;
|
|
8
|
+
private tripleMatchToHash;
|
|
9
|
+
registerListener(tripleMatch: TripleMatch, callback: () => void): void;
|
|
10
|
+
removeListener(callback: () => void): void;
|
|
11
|
+
notifyListenersOfChanges(changes: DatasetChanges<Quad>): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateManager = void 0;
|
|
4
|
+
const dataset_1 = require("@ldo/dataset");
|
|
5
|
+
const jsonld_dataset_proxy_1 = require("@ldo/jsonld-dataset-proxy");
|
|
6
|
+
class UpdateManager {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.tripleMatchListenerMap = {};
|
|
9
|
+
this.listenerHashMap = new Map();
|
|
10
|
+
}
|
|
11
|
+
tripleMatchToHash(tripleMatch) {
|
|
12
|
+
return `${(0, jsonld_dataset_proxy_1.nodeToString)(tripleMatch[0])}${(0, jsonld_dataset_proxy_1.nodeToString)(tripleMatch[1])}${(0, jsonld_dataset_proxy_1.nodeToString)(tripleMatch[2])}`;
|
|
13
|
+
}
|
|
14
|
+
registerListener(tripleMatch, callback) {
|
|
15
|
+
const hash = this.tripleMatchToHash(tripleMatch);
|
|
16
|
+
if (!this.tripleMatchListenerMap[hash]) {
|
|
17
|
+
this.tripleMatchListenerMap[hash] = new Set();
|
|
18
|
+
}
|
|
19
|
+
if (!this.listenerHashMap.has(callback)) {
|
|
20
|
+
this.listenerHashMap.set(callback, new Set());
|
|
21
|
+
}
|
|
22
|
+
this.tripleMatchListenerMap[hash].add(callback);
|
|
23
|
+
this.listenerHashMap.get(callback)?.add(hash);
|
|
24
|
+
}
|
|
25
|
+
removeListener(callback) {
|
|
26
|
+
const hashSet = this.listenerHashMap.get(callback);
|
|
27
|
+
if (hashSet) {
|
|
28
|
+
hashSet.forEach((hash) => {
|
|
29
|
+
this.tripleMatchListenerMap[hash]?.delete(callback);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
notifyListenersOfChanges(changes) {
|
|
34
|
+
const listenersToNotify = new Set();
|
|
35
|
+
const allQuads = (0, dataset_1.createDataset)();
|
|
36
|
+
allQuads.addAll(changes.added || []);
|
|
37
|
+
allQuads.addAll(changes.removed || []);
|
|
38
|
+
allQuads.forEach((tempQuad) => {
|
|
39
|
+
const quad = tempQuad;
|
|
40
|
+
const tripleMatches = [
|
|
41
|
+
[null, null, null],
|
|
42
|
+
[quad.subject, null, null],
|
|
43
|
+
[quad.subject, quad.predicate, null],
|
|
44
|
+
[quad.subject, null, quad.object],
|
|
45
|
+
[null, quad.predicate, null],
|
|
46
|
+
[null, quad.predicate, quad.object],
|
|
47
|
+
[null, null, quad.object],
|
|
48
|
+
[quad.subject, quad.predicate, quad.object],
|
|
49
|
+
];
|
|
50
|
+
tripleMatches.forEach((tripleMatch) => {
|
|
51
|
+
const hash = this.tripleMatchToHash(tripleMatch);
|
|
52
|
+
this.tripleMatchListenerMap[hash]?.forEach((callback) => {
|
|
53
|
+
listenersToNotify.add(callback);
|
|
54
|
+
});
|
|
55
|
+
delete this.tripleMatchListenerMap[hash];
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
listenersToNotify.forEach((listener) => {
|
|
59
|
+
listener();
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.UpdateManager = UpdateManager;
|
|
64
|
+
//# sourceMappingURL=UpdateManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateManager.js","sourceRoot":"","sources":["../../../src/ldoHooks/helpers/UpdateManager.ts"],"names":[],"mappings":";;;AACA,0CAA6C;AAO7C,oEAAyD;AAKzD,MAAa,aAAa;IAA1B;QACU,2BAAsB,GAAoC,EAAE,CAAC;QAC7D,oBAAe,GAAiC,IAAI,GAAG,EAAE,CAAC;IAoEpE,CAAC;IAlES,iBAAiB,CAAC,WAAwB;QAChD,OAAO,GAAG,IAAA,mCAAY,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,IAAA,mCAAY,EACnD,WAAW,CAAC,CAAC,CAAC,CACf,GAAG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
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchingObjects.js","sourceRoot":"","sources":["../../src/ldoHooks/useMatchingObjects.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchingSubjects.js","sourceRoot":"","sources":["../../src/ldoHooks/useMatchingSubjects.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSubject = void 0;
|
|
4
|
+
const jsonld_dataset_proxy_1 = require("@ldo/jsonld-dataset-proxy");
|
|
5
|
+
const ldo_1 = require("@ldo/ldo");
|
|
6
|
+
const LdoContext_1 = require("../LdoContext");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const TrackingProxyContext_1 = require("./helpers/TrackingProxyContext");
|
|
9
|
+
const data_model_1 = require("@rdfjs/data-model");
|
|
10
|
+
function useSubject(shapeType, subject) {
|
|
11
|
+
const { dataset, updateManager } = (0, LdoContext_1.useLdoContext)();
|
|
12
|
+
const [forceUpdateCounter, setForceUpdateCounter] = (0, react_1.useState)(0);
|
|
13
|
+
const forceUpdate = (0, react_1.useCallback)(() => setForceUpdateCounter((val) => val + 1), [setForceUpdateCounter]);
|
|
14
|
+
const linkedDataObject = (0, react_1.useMemo)(() => {
|
|
15
|
+
const contextUtil = new jsonld_dataset_proxy_1.ContextUtil(shapeType.context);
|
|
16
|
+
const proxyContext = new TrackingProxyContext_1.TrackingProxyContext({
|
|
17
|
+
dataset,
|
|
18
|
+
contextUtil,
|
|
19
|
+
writeGraphs: [(0, data_model_1.defaultGraph)()],
|
|
20
|
+
languageOrdering: ["none", "en", "other"],
|
|
21
|
+
}, updateManager, forceUpdate);
|
|
22
|
+
const builder = new ldo_1.LdoBuilder(new jsonld_dataset_proxy_1.JsonldDatasetProxyBuilder(proxyContext), shapeType);
|
|
23
|
+
return builder.fromSubject(subject);
|
|
24
|
+
}, [
|
|
25
|
+
shapeType,
|
|
26
|
+
subject,
|
|
27
|
+
dataset,
|
|
28
|
+
updateManager,
|
|
29
|
+
forceUpdateCounter,
|
|
30
|
+
forceUpdate,
|
|
31
|
+
]);
|
|
32
|
+
(0, react_1.useEffect)(() => {
|
|
33
|
+
return () => updateManager.removeListener(forceUpdate);
|
|
34
|
+
}, [shapeType, subject]);
|
|
35
|
+
return [linkedDataObject, undefined];
|
|
36
|
+
}
|
|
37
|
+
exports.useSubject = useSubject;
|
|
38
|
+
//# sourceMappingURL=useSubject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubject.js","sourceRoot":"","sources":["../../src/ldoHooks/useSubject.ts"],"names":[],"mappings":";;;AACA,oEAGmC;AAEnC,kCAAsC;AACtC,8CAA8C;AAC9C,iCAAkE;AAClE,yEAAsE;AACtE,kDAAiD;AAEjD,SAAgB,UAAU,CACxB,SAA0B,EAC1B,OAA6B;IAE7B,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IAEnD,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAChE,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,GAAG,EAAE,CAAC,qBAAqB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,EAC7C,CAAC,qBAAqB,CAAC,CACxB,CAAC;IAGF,MAAM,gBAAgB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAEpC,MAAM,WAAW,GAAG,IAAI,kCAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACvD,MAAM,YAAY,GAAG,IAAI,2CAAoB,CAC3C;YACE,OAAO;YACP,WAAW;YACX,WAAW,EAAE,CAAC,IAAA,yBAAY,GAAE,CAAC;YAC7B,gBAAgB,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC;SAC1C,EACD,aAAa,EACb,WAAW,CACZ,CAAC;QACF,MAAM,OAAO,GAAG,IAAI,gBAAU,CAC5B,IAAI,gDAAyB,CAAC,YAAY,CAAC,EAC3C,SAAS,CACV,CAAC;QACF,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC,EAAE;QACD,SAAS;QACT,OAAO;QACP,OAAO;QACP,aAAa;QACb,kBAAkB;QAClB,WAAW;KACZ,CAAC,CAAC;IAEH,IAAA,iBAAS,EAAC,GAAG,EAAE;QAEb,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzB,OAAO,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;AACvC,CAAC;AA9CD,gCA8CC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BinaryResourceStoreDependencies } from "./document/resource/binaryResource/BinaryResourceStore";
|
|
3
|
+
import type { DataResourceStoreDependencies } from "./document/resource/dataResource/DataResourceStore";
|
|
4
|
+
import type { AccessRulesStoreDependencies } from "./document/accessRules/AccessRulesStore";
|
|
5
|
+
import type { ContainerResourceStoreDependencies } from "./document/resource/dataResource/containerResource/ContainerResourceStore";
|
|
6
|
+
export interface LdoContextData extends BinaryResourceStoreDependencies, DataResourceStoreDependencies, AccessRulesStoreDependencies, ContainerResourceStoreDependencies {
|
|
7
|
+
}
|
|
8
|
+
export declare const LdoContextProvider: import("react").Provider<LdoContextData>;
|
|
9
|
+
export declare const useLdoContext: () => LdoContextData;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLdoContext = exports.LdoContextProvider = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const LdoContext = (0, react_1.createContext)({});
|
|
6
|
+
exports.LdoContextProvider = LdoContext.Provider;
|
|
7
|
+
const useLdoContext = () => (0, react_1.useContext)(LdoContext);
|
|
8
|
+
exports.useLdoContext = useLdoContext;
|
|
9
|
+
//# sourceMappingURL=LdoContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LdoContext.js","sourceRoot":"","sources":["../../src/old/LdoContext.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAelD,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAiB,EAAE,CAAC,CAAC;AAExC,QAAA,kBAAkB,GAAG,UAAU,CAAC,QAAQ,CAAC;AAC/C,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAA,kBAAU,EAAC,UAAU,CAAC,CAAC;AAA7C,QAAA,aAAa,iBAAgC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FunctionComponent, PropsWithChildren } from "react";
|
|
2
|
+
import type { LdoContextData } from "./LdoContext";
|
|
3
|
+
import type { Dataset } from "@rdfjs/types";
|
|
4
|
+
export interface LdoProviderProps extends PropsWithChildren {
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
dataset?: Dataset;
|
|
7
|
+
onDocumentError?: LdoContextData["onDocumentError"];
|
|
8
|
+
}
|
|
9
|
+
export declare const LdoProvider: FunctionComponent<PropsWithChildren<LdoProviderProps>>;
|