@ldo/solid-react 0.0.1-alpha.17 → 0.0.1-alpha.19

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.
Files changed (168) hide show
  1. package/dist/BrowserSolidLdoProvider.js.map +1 -1
  2. package/dist/UnauthenticatedSolidLdoProvider.d.ts +2 -0
  3. package/dist/UnauthenticatedSolidLdoProvider.js +41 -0
  4. package/dist/UnauthenticatedSolidLdoProvider.js.map +1 -0
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +1 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/useLdoMethods.d.ts +5 -5
  9. package/dist/useLdoMethods.js +5 -19
  10. package/dist/useLdoMethods.js.map +1 -1
  11. package/dist/useResource.js.map +1 -1
  12. package/dist/useRootContainer.d.ts +2 -1
  13. package/dist/useRootContainer.js +5 -2
  14. package/dist/useRootContainer.js.map +1 -1
  15. package/dist/util/TrackingProxyContext.js.map +1 -1
  16. package/package.json +17 -12
  17. package/src/UnauthenticatedSolidLdoProvider.tsx +62 -0
  18. package/src/index.ts +1 -0
  19. package/src/useLdoMethods.ts +29 -37
  20. package/src/useResource.ts +1 -0
  21. package/src/useRootContainer.ts +9 -2
  22. package/src/util/TrackingProxyContext.ts +10 -0
  23. package/dist/LdoContext.d.ts +0 -9
  24. package/dist/LdoContext.js +0 -9
  25. package/dist/LdoContext.js.map +0 -1
  26. package/dist/LdoProvider.d.ts +0 -9
  27. package/dist/LdoProvider.js +0 -45
  28. package/dist/LdoProvider.js.map +0 -1
  29. package/dist/SolidAuthProvider.d.ts +0 -17
  30. package/dist/SolidAuthProvider.js +0 -56
  31. package/dist/SolidAuthProvider.js.map +0 -1
  32. package/dist/document/DocumentStore.d.ts +0 -11
  33. package/dist/document/DocumentStore.js +0 -24
  34. package/dist/document/DocumentStore.js.map +0 -1
  35. package/dist/document/FetchableDocument.d.ts +0 -28
  36. package/dist/document/FetchableDocument.js +0 -75
  37. package/dist/document/FetchableDocument.js.map +0 -1
  38. package/dist/document/accessRules/AccessRules.d.ts +0 -19
  39. package/dist/document/accessRules/AccessRules.js +0 -53
  40. package/dist/document/accessRules/AccessRules.js.map +0 -1
  41. package/dist/document/accessRules/AccessRulesStore.d.ts +0 -10
  42. package/dist/document/accessRules/AccessRulesStore.js +0 -12
  43. package/dist/document/accessRules/AccessRulesStore.js.map +0 -1
  44. package/dist/document/errors/DocumentError.d.ts +0 -5
  45. package/dist/document/errors/DocumentError.js +0 -11
  46. package/dist/document/errors/DocumentError.js.map +0 -1
  47. package/dist/document/errors/DocumentFetchError.d.ts +0 -6
  48. package/dist/document/errors/DocumentFetchError.js +0 -12
  49. package/dist/document/errors/DocumentFetchError.js.map +0 -1
  50. package/dist/document/resource/Resource.d.ts +0 -23
  51. package/dist/document/resource/Resource.js +0 -48
  52. package/dist/document/resource/Resource.js.map +0 -1
  53. package/dist/document/resource/binaryResource/BinaryResource.d.ts +0 -7
  54. package/dist/document/resource/binaryResource/BinaryResource.js +0 -11
  55. package/dist/document/resource/binaryResource/BinaryResource.js.map +0 -1
  56. package/dist/document/resource/binaryResource/BinaryResourceStore.d.ts +0 -10
  57. package/dist/document/resource/binaryResource/BinaryResourceStore.js +0 -15
  58. package/dist/document/resource/binaryResource/BinaryResourceStore.js.map +0 -1
  59. package/dist/document/resource/dataResource/DataResource.d.ts +0 -20
  60. package/dist/document/resource/dataResource/DataResource.js +0 -81
  61. package/dist/document/resource/dataResource/DataResource.js.map +0 -1
  62. package/dist/document/resource/dataResource/DataResourceStore.d.ts +0 -10
  63. package/dist/document/resource/dataResource/DataResourceStore.js +0 -15
  64. package/dist/document/resource/dataResource/DataResourceStore.js.map +0 -1
  65. package/dist/document/resource/dataResource/containerResource/ContainerResource.d.ts +0 -20
  66. package/dist/document/resource/dataResource/containerResource/ContainerResource.js +0 -74
  67. package/dist/document/resource/dataResource/containerResource/ContainerResource.js.map +0 -1
  68. package/dist/document/resource/dataResource/containerResource/ContainerResourceStore.d.ts +0 -13
  69. package/dist/document/resource/dataResource/containerResource/ContainerResourceStore.js +0 -33
  70. package/dist/document/resource/dataResource/containerResource/ContainerResourceStore.js.map +0 -1
  71. package/dist/documentHooks/useAccessRules.d.ts +0 -3
  72. package/dist/documentHooks/useAccessRules.js +0 -16
  73. package/dist/documentHooks/useAccessRules.js.map +0 -1
  74. package/dist/documentHooks/useBinaryResource.d.ts +0 -2
  75. package/dist/documentHooks/useBinaryResource.js +0 -16
  76. package/dist/documentHooks/useBinaryResource.js.map +0 -1
  77. package/dist/documentHooks/useContainerResource.d.ts +0 -2
  78. package/dist/documentHooks/useContainerResource.js +0 -16
  79. package/dist/documentHooks/useContainerResource.js.map +0 -1
  80. package/dist/documentHooks/useDataResource.d.ts +0 -2
  81. package/dist/documentHooks/useDataResource.js +0 -16
  82. package/dist/documentHooks/useDataResource.js.map +0 -1
  83. package/dist/documentHooks/useDocument.d.ts +0 -5
  84. package/dist/documentHooks/useDocument.js +0 -20
  85. package/dist/documentHooks/useDocument.js.map +0 -1
  86. package/dist/ldo/solid.context.d.ts +0 -2
  87. package/dist/ldo/solid.context.js +0 -33
  88. package/dist/ldo/solid.context.js.map +0 -1
  89. package/dist/ldo/solid.schema.d.ts +0 -2
  90. package/dist/ldo/solid.schema.js +0 -211
  91. package/dist/ldo/solid.schema.js.map +0 -1
  92. package/dist/ldo/solid.shapeTypes.d.ts +0 -4
  93. package/dist/ldo/solid.shapeTypes.js +0 -16
  94. package/dist/ldo/solid.shapeTypes.js.map +0 -1
  95. package/dist/ldo/solid.typings.d.ts +0 -26
  96. package/dist/ldo/solid.typings.js +0 -3
  97. package/dist/ldo/solid.typings.js.map +0 -1
  98. package/dist/ldoHooks/helpers/TrackingProxyContext.d.ts +0 -10
  99. package/dist/ldoHooks/helpers/TrackingProxyContext.js +0 -68
  100. package/dist/ldoHooks/helpers/TrackingProxyContext.js.map +0 -1
  101. package/dist/ldoHooks/helpers/UpdateManager.d.ts +0 -12
  102. package/dist/ldoHooks/helpers/UpdateManager.js +0 -64
  103. package/dist/ldoHooks/helpers/UpdateManager.js.map +0 -1
  104. package/dist/ldoHooks/useMatchingObjects.d.ts +0 -0
  105. package/dist/ldoHooks/useMatchingObjects.js +0 -2
  106. package/dist/ldoHooks/useMatchingObjects.js.map +0 -1
  107. package/dist/ldoHooks/useMatchingSubjects.d.ts +0 -0
  108. package/dist/ldoHooks/useMatchingSubjects.js +0 -2
  109. package/dist/ldoHooks/useMatchingSubjects.js.map +0 -1
  110. package/dist/ldoHooks/useSubject.d.ts +0 -3
  111. package/dist/ldoHooks/useSubject.js +0 -38
  112. package/dist/ldoHooks/useSubject.js.map +0 -1
  113. package/dist/old/LdoContext.d.ts +0 -9
  114. package/dist/old/LdoContext.js +0 -9
  115. package/dist/old/LdoContext.js.map +0 -1
  116. package/dist/old/LdoProvider.d.ts +0 -9
  117. package/dist/old/LdoProvider.js +0 -41
  118. package/dist/old/LdoProvider.js.map +0 -1
  119. package/dist/old/SolidAuthProvider.d.ts +0 -3
  120. package/dist/old/SolidAuthProvider.js +0 -56
  121. package/dist/old/SolidAuthProvider.js.map +0 -1
  122. package/dist/old/documentHooks/useAccessRules.d.ts +0 -3
  123. package/dist/old/documentHooks/useAccessRules.js +0 -17
  124. package/dist/old/documentHooks/useAccessRules.js.map +0 -1
  125. package/dist/old/documentHooks/useBinaryResource.d.ts +0 -2
  126. package/dist/old/documentHooks/useBinaryResource.js +0 -11
  127. package/dist/old/documentHooks/useBinaryResource.js.map +0 -1
  128. package/dist/old/documentHooks/useContainerResource.d.ts +0 -2
  129. package/dist/old/documentHooks/useContainerResource.js +0 -11
  130. package/dist/old/documentHooks/useContainerResource.js.map +0 -1
  131. package/dist/old/documentHooks/useDataResource.d.ts +0 -2
  132. package/dist/old/documentHooks/useDataResource.js +0 -11
  133. package/dist/old/documentHooks/useDataResource.js.map +0 -1
  134. package/dist/old/documentHooks/useDocument.d.ts +0 -6
  135. package/dist/old/documentHooks/useDocument.js +0 -24
  136. package/dist/old/documentHooks/useDocument.js.map +0 -1
  137. package/dist/old/ldoHooks/helpers/TrackingProxyContext.d.ts +0 -10
  138. package/dist/old/ldoHooks/helpers/TrackingProxyContext.js +0 -68
  139. package/dist/old/ldoHooks/helpers/TrackingProxyContext.js.map +0 -1
  140. package/dist/old/ldoHooks/helpers/UpdateManager.d.ts +0 -9
  141. package/dist/old/ldoHooks/helpers/UpdateManager.js +0 -61
  142. package/dist/old/ldoHooks/helpers/UpdateManager.js.map +0 -1
  143. package/dist/old/ldoHooks/useMatchingObjects.d.ts +0 -0
  144. package/dist/old/ldoHooks/useMatchingObjects.js +0 -2
  145. package/dist/old/ldoHooks/useMatchingObjects.js.map +0 -1
  146. package/dist/old/ldoHooks/useMatchingSubjects.d.ts +0 -0
  147. package/dist/old/ldoHooks/useMatchingSubjects.js +0 -2
  148. package/dist/old/ldoHooks/useMatchingSubjects.js.map +0 -1
  149. package/dist/old/ldoHooks/useSubject.d.ts +0 -3
  150. package/dist/old/ldoHooks/useSubject.js +0 -38
  151. package/dist/old/ldoHooks/useSubject.js.map +0 -1
  152. package/dist/old/useLdo.d.ts +0 -18
  153. package/dist/old/useLdo.js +0 -46
  154. package/dist/old/useLdo.js.map +0 -1
  155. package/dist/useLdo.d.ts +0 -18
  156. package/dist/useLdo.js +0 -46
  157. package/dist/useLdo.js.map +0 -1
  158. package/dist/util/changesToSparqlUpdate.d.ts +0 -3
  159. package/dist/util/changesToSparqlUpdate.js +0 -26
  160. package/dist/util/changesToSparqlUpdate.js.map +0 -1
  161. package/dist/util/createGlobalHook.d.ts +0 -6
  162. package/dist/util/createGlobalHook.js +0 -18
  163. package/dist/util/createGlobalHook.js.map +0 -1
  164. package/dist/util/splitChangesByGraph.d.ts +0 -6
  165. package/dist/util/splitChangesByGraph.js +0 -45
  166. package/dist/util/splitChangesByGraph.js.map +0 -1
  167. package/src/util/createWrapperProxy.ts +0 -7
  168. package/src/util/useForceReload.ts +0 -6
@@ -1 +0,0 @@
1
- {"version":3,"file":"solid.typings.js","sourceRoot":"","sources":["../../src/ldo/solid.typings.ts"],"names":[],"mappings":""}
@@ -1,10 +0,0 @@
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
- }
@@ -1,68 +0,0 @@
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
@@ -1 +0,0 @@
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,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,oBAAoB;QAC5B,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,EAAE,CAAC;QACjD,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,CAAC;QACvC,MAAM,cAAc,GAA4C,CAC9D,MAA0B,EAC1B,GAAoB,EACpB,QAAQ,EACR,EAAE;YACF,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;aAE5B;iBAAM,IAAI,GAAG,K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Q,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"}
@@ -1,12 +0,0 @@
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
- }
@@ -1,64 +0,0 @@
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
@@ -1 +0,0 @@
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,oB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C,IAAI,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACrC,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtED,sCAsEC"}
File without changes
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=useMatchingObjects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMatchingObjects.js","sourceRoot":"","sources":["../../src/ldoHooks/useMatchingObjects.ts"],"names":[],"mappings":""}
File without changes
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=useMatchingSubjects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useMatchingSubjects.js","sourceRoot":"","sources":["../../src/ldoHooks/useMatchingSubjects.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import type { SubjectType } from "@ldo/jsonld-dataset-proxy";
2
- import type { ShapeType, LdoBase } from "@ldo/ldo";
3
- export declare function useSubject<Type extends LdoBase>(shapeType: ShapeType<Type>, subject: string | SubjectType): [Type, undefined] | [undefined, Error];
@@ -1,38 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
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;
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,9 +0,0 @@
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>>;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LdoProvider = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const cross_fetch_1 = __importDefault(require("cross-fetch"));
10
- const ldo_1 = require("@ldo/ldo");
11
- const LdoContext_1 = require("./LdoContext");
12
- const UpdateManager_1 = require("./ldoHooks/helpers/UpdateManager");
13
- const LdoProvider = ({ dataset, fetch, onDocumentError, children }) => {
14
- const finalFetch = (0, react_1.useMemo)(() => fetch || cross_fetch_1.default, [fetch]);
15
- const ldoDataset = (0, react_1.useMemo)(() => (0, ldo_1.createLdoDataset)(dataset), [dataset]);
16
- const storeDependencies = (0, react_1.useMemo)(() => {
17
- const dependencies = {
18
- onDocumentError,
19
- fetch: finalFetch,
20
- dataset: ldoDataset,
21
- updateManager: new UpdateManager_1.UpdateManager(),
22
- };
23
- const binaryResourceStore = new BinaryResourceStore(dependencies);
24
- const dataResourceStore = new DataResourceStore(dependencies);
25
- const containerResourceStore = new ContainerResourceStore(dependencies);
26
- const accessRulesStore = new AccessRulesStore(dependencies);
27
- dependencies.binaryResourceStore = binaryResourceStore;
28
- dependencies.dataResourceStore = dataResourceStore;
29
- dependencies.containerResourceStore = containerResourceStore;
30
- dependencies.accessRulesStore = accessRulesStore;
31
- return dependencies;
32
- }, []);
33
- (0, react_1.useEffect)(() => {
34
- storeDependencies.fetch = finalFetch;
35
- storeDependencies.dataset = ldoDataset;
36
- storeDependencies.onDocumentError = onDocumentError;
37
- }, [finalFetch, ldoDataset, onDocumentError]);
38
- return ((0, jsx_runtime_1.jsx)(LdoContext_1.LdoContextProvider, { value: storeDependencies, children: children }));
39
- };
40
- exports.LdoProvider = LdoProvider;
41
- //# sourceMappingURL=LdoProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LdoProvider.js","sourceRoot":"","sources":["../../src/old/LdoProvider.tsx"],"names":[],"mappings":";;;;;;;AACA,iCAAkD;AAClD,8DAAqC;AACrC,kCAA4C;AAE5C,6CAAkD;AAClD,oEAAiE;AAY1D,MAAM,WAAW,GAEpB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,EAAE,EAAE;IACpD,MAAM,UAAU,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,KAAK,IAAI,qBAAU,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,IAAA,sBAAgB,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAGvE,MAAM,iBAAiB,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAIrC,MAAM,YAAY,GAAmB;YACnC,eAAe;YACf,KAAK,EAAE,UAAU;YACjB,OAAO,EAAE,UAAU;YACnB,aAAa,EAAE,IAAI,6BAAa,EAAE;SACnC,CAAC;QACF,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAClE,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAC9D,MAAM,sBAAsB,GAAG,IAAI,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACxE,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC5D,YAAY,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QACvD,YAAY,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QACnD,YAAY,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;QAC7D,YAAY,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACjD,OAAO,YAAY,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;IAGP,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,iBAAiB,CAAC,KAAK,GAAG,UAAU,CAAC;QACrC,iBAAiB,CAAC,OAAO,GAAG,UAAU,CAAC;QACvC,iBAAiB,CAAC,eAAe,GAAG,eAAe,CAAC;IACtD,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC;IAE9C,OAAO,CACL,uBAAC,+BAAkB,IAAC,KAAK,EAAE,iBAAiB,YACzC,QAAQ,GACU,CACtB,CAAC;AACJ,CAAC,CAAC;AAxCW,QAAA,WAAW,eAwCtB"}
@@ -1,3 +0,0 @@
1
- export declare const SolidAuthContext: any;
2
- export declare const SolidAuthProvider: any;
3
- export declare const useSolidAuth: any;
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSolidAuth = exports.SolidAuthProvider = exports.SolidAuthContext = void 0;
4
- const react_1 = require("react");
5
- const solid_authn_react_native_1 = require("solid-authn-react-native");
6
- const createGlobalHook_1 = require("./util/createGlobalHook");
7
- const PRE_REDIRECT_URI = "PRE_REDIRECT_URI";
8
- function useAuthGlobalHookFunc() {
9
- const [session, setSession] = (0, react_1.useState)((0, solid_authn_react_native_1.getDefaultSession)().info);
10
- const [ranInitialAuthCheck, setRanInitialAuthCheck] = (0, react_1.useState)(false);
11
- const runInitialAuthCheck = (0, react_1.useCallback)(async () => {
12
- if (!window.localStorage.getItem(PRE_REDIRECT_URI)) {
13
- window.localStorage.setItem(PRE_REDIRECT_URI, window.location.href);
14
- }
15
- await (0, solid_authn_react_native_1.handleIncomingRedirect)({
16
- restorePreviousSession: true,
17
- });
18
- setSession({ ...(0, solid_authn_react_native_1.getDefaultSession)().info });
19
- window.history.replaceState({}, "", window.localStorage.getItem(PRE_REDIRECT_URI));
20
- window.localStorage.removeItem(PRE_REDIRECT_URI);
21
- setRanInitialAuthCheck(true);
22
- }, []);
23
- const login = (0, react_1.useCallback)(async (issuer, clientName = "Solid App") => {
24
- window.localStorage.setItem(PRE_REDIRECT_URI, window.location.href);
25
- await (0, solid_authn_react_native_1.login)({
26
- oidcIssuer: issuer,
27
- redirectUrl: window.location.href,
28
- clientName,
29
- });
30
- setSession({ ...(0, solid_authn_react_native_1.getDefaultSession)().info });
31
- }, []);
32
- const logout = (0, react_1.useCallback)(async () => {
33
- await (0, solid_authn_react_native_1.logout)();
34
- setSession({ ...(0, solid_authn_react_native_1.getDefaultSession)().info });
35
- }, []);
36
- const signUp = (0, react_1.useCallback)(async (issuer) => {
37
- console.log(`Signup Pressed with issuer ${issuer}`);
38
- }, []);
39
- (0, react_1.useEffect)(() => {
40
- runInitialAuthCheck();
41
- }, []);
42
- return (0, react_1.useMemo)(() => ({
43
- runInitialAuthCheck,
44
- login,
45
- logout,
46
- signUp,
47
- session,
48
- ranInitialAuthCheck,
49
- fetch: solid_authn_react_native_1.fetch,
50
- }), [login, logout, ranInitialAuthCheck, runInitialAuthCheck, session, signUp]);
51
- }
52
- const authGlobalHook = (0, createGlobalHook_1.createGlobalHook)(useAuthGlobalHookFunc);
53
- exports.SolidAuthContext = authGlobalHook.Context;
54
- exports.SolidAuthProvider = authGlobalHook.Provider;
55
- exports.useSolidAuth = authGlobalHook.useGlobal;
56
- //# sourceMappingURL=SolidAuthProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SolidAuthProvider.js","sourceRoot":"","sources":["../../src/old/SolidAuthProvider.ts"],"names":[],"mappings":";;;AAAA,iCAAkE;AAElE,uEAMkC;AAElC,8DAA2D;AAE3D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAY5C,SAAS,qBAAqB;IAC5B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EACpC,IAAA,4CAAiB,GAAE,CAAC,IAAI,CACzB,CAAC;IACF,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEtE,MAAM,mBAAmB,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAI,EAAE;QAEjD,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;YAClD,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACrE;QAED,MAAM,IAAA,iDAAsB,EAAC;YAC3B,sBAAsB,EAAE,IAAI;SAC7B,CAAC,CAAC;QACH,UAAU,CAAC,EAAE,GAAG,IAAA,4CAAiB,GAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAE5C,MAAM,CAAC,OAAO,CAAC,YAAY,CACzB,EAAE,EACF,EAAE,EACF,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,gBA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EAAE,gCAAY;KACpB,CAAC,EACF,CAAC,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,CAAC,CAC3E,CAAC;AACJ,CAAC;AAED,MAAM,cAAc,GAAG,IAAA,mCAAgB,EAAC,qBAAqB,CAAC,CAAC;AAElD,QAAA,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC;AAC1C,QAAA,iBAAiB,GAAG,cAAc,CAAC,QAAQ,CAAC;AAC5C,QAAA,YAAY,GAAG,cAAc,CAAC,SAAS,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { UseDocumentOptions } from "./useDocument";
2
- import type { Resource } from "../document/resource/Resource";
3
- export declare function useAccessRules(resource: string | Resource, options?: UseDocumentOptions): any;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useAccessRules = void 0;
4
- const react_1 = require("react");
5
- const LdoContext_1 = require("../LdoContext");
6
- const useDocument_1 = require("./useDocument");
7
- function useAccessRules(resource, options) {
8
- const { dataResourceStore, accessRulesStore } = (0, LdoContext_1.useLdoContext)();
9
- const realResource = (0, react_1.useMemo)(() => {
10
- return typeof resource === "string"
11
- ? dataResourceStore.get(resource)
12
- : resource;
13
- }, [resource]);
14
- return (0, useDocument_1.useDocument)(realResource, accessRulesStore, options);
15
- }
16
- exports.useAccessRules = useAccessRules;
17
- //# sourceMappingURL=useAccessRules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAccessRules.js","sourceRoot":"","sources":["../../../src/old/documentHooks/useAccessRules.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,8CAA8C;AAE9C,+CAA4C;AAG5C,SAAgB,cAAc,CAC5B,QAA2B,EAC3B,OAA4B;IAE5B,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IAChE,MAAM,YAAY,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,OAAO,OAAO,QAAQ,KAAK,QAAQ;YACjC,CAAC,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC;YACjC,CAAC,CAAC,QAAQ,CAAC;IACf,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,IAAA,yBAAW,EAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAXD,wCAWC"}
@@ -1,2 +0,0 @@
1
- import type { UseDocumentOptions } from "./useDocument";
2
- export declare function useBinaryResource(uri: string, options?: UseDocumentOptions): any;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useBinaryResource = void 0;
4
- const LdoContext_1 = require("../LdoContext");
5
- const useDocument_1 = require("./useDocument");
6
- function useBinaryResource(uri, options) {
7
- const { binaryResourceStore } = (0, LdoContext_1.useLdoContext)();
8
- return (0, useDocument_1.useDocument)(uri, binaryResourceStore, options);
9
- }
10
- exports.useBinaryResource = useBinaryResource;
11
- //# sourceMappingURL=useBinaryResource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBinaryResource.js","sourceRoot":"","sources":["../../../src/old/documentHooks/useBinaryResource.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAE9C,+CAA4C;AAE5C,SAAgB,iBAAiB,CAAC,GAAW,EAAE,OAA4B;IACzE,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IAChD,OAAO,IAAA,yBAAW,EAAC,GAAG,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC;AAHD,8CAGC"}
@@ -1,2 +0,0 @@
1
- import type { UseDocumentOptions } from "./useDocument";
2
- export declare function useContainerResource(uri: string, options?: UseDocumentOptions): any;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useContainerResource = void 0;
4
- const LdoContext_1 = require("../LdoContext");
5
- const useDocument_1 = require("./useDocument");
6
- function useContainerResource(uri, options) {
7
- const { containerResourceStore } = (0, LdoContext_1.useLdoContext)();
8
- return (0, useDocument_1.useDocument)(uri, containerResourceStore, options);
9
- }
10
- exports.useContainerResource = useContainerResource;
11
- //# sourceMappingURL=useContainerResource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useContainerResource.js","sourceRoot":"","sources":["../../../src/old/documentHooks/useContainerResource.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAE9C,+CAA4C;AAE5C,SAAgB,oBAAoB,CAClC,GAAW,EACX,OAA4B;IAE5B,MAAM,EAAE,sBAAsB,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IACnD,OAAO,IAAA,yBAAW,EAAC,GAAG,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC;AAND,oDAMC"}
@@ -1,2 +0,0 @@
1
- import type { UseDocumentOptions } from "./useDocument";
2
- export declare function useDataResource(uri: string, options?: UseDocumentOptions): any;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDataResource = void 0;
4
- const LdoContext_1 = require("../LdoContext");
5
- const useDocument_1 = require("./useDocument");
6
- function useDataResource(uri, options) {
7
- const { dataResourceStore } = (0, LdoContext_1.useLdoContext)();
8
- return (0, useDocument_1.useDocument)(uri, dataResourceStore, options);
9
- }
10
- exports.useDataResource = useDataResource;
11
- //# sourceMappingURL=useDataResource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDataResource.js","sourceRoot":"","sources":["../../../src/old/documentHooks/useDataResource.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAE9C,+CAA4C;AAE5C,SAAgB,eAAe,CAAC,GAAW,EAAE,OAA4B;IACvE,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,0BAAa,GAAE,CAAC;IAC9C,OAAO,IAAA,yBAAW,EAAC,GAAG,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAHD,0CAGC"}
@@ -1,6 +0,0 @@
1
- import type { DocumentStore, DocumentStoreDependencies } from "../document/DocumentStore";
2
- import type { FetchableDocument } from "../document/FetchableDocument";
3
- export interface UseDocumentOptions {
4
- suppressLoadOnMount: boolean;
5
- }
6
- export declare function useDocument<DocumentType extends FetchableDocument, Initializer>(initializer: Initializer, documentStore: DocumentStore<DocumentType, Initializer, DocumentStoreDependencies>, options?: UseDocumentOptions): any;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useDocument = void 0;
4
- const react_1 = require("react");
5
- const useForceReload_1 = require("../util/useForceReload");
6
- function useDocument(initializer, documentStore, options) {
7
- const document = (0, react_1.useMemo)(() => {
8
- return documentStore.get(initializer);
9
- }, [initializer, documentStore]);
10
- const forceUpdate = (0, useForceReload_1.useForceUpdate)();
11
- (0, react_1.useEffect)(() => {
12
- function onStateUpdateCallback() {
13
- forceUpdate();
14
- }
15
- document.onStateUpdate(onStateUpdateCallback);
16
- if (!options?.suppressLoadOnMount) {
17
- document.read();
18
- }
19
- return () => document.offStateUpdate(onStateUpdateCallback);
20
- }, []);
21
- return document;
22
- }
23
- exports.useDocument = useDocument;
24
- //# sourceMappingURL=useDocument.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDocument.js","sourceRoot":"","sources":["../../../src/old/documentHooks/useDocument.ts"],"names":[],"mappings":";;;AAAA,iCAA2C;AAM3C,2DAAwD;AAMxD,SAAgB,WAAW,CAIzB,WAAwB,EACxB,aAIC,EACD,OAA4B;IAE5B,MAAM,QAAQ,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC5B,OAAO,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;IAEjC,MAAM,WAAW,GAAG,IAAA,+BAAc,GAAE,CAAC;IAErC,IAAA,iBAAS,EAAC,GAAG,EAAE;QAEb,SAAS,qBAAqB;YAC5B,WAAW,EAAE,CAAC;QAChB,CAAC;QACD,QAAQ,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,EAAE,mBAAmB,EAAE;YACjC,QAAQ,CAAC,IAAI,EAAE,CAAC;SACjB;QACD,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;IAC9D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC;AAhCD,kCAgCC"}
@@ -1,10 +0,0 @@
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
- }
@@ -1,68 +0,0 @@
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, 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, 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], null], 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
@@ -1 +0,0 @@
1
- {"version":3,"file":"TrackingProxyContext.js","sourceRoot":"","sources":["../../../../src/old/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,QAAQ,GAA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WAAW,CAAC,GAAG,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,EAAE,IAAI,CAAC,EAChD,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"}
@@ -1,9 +0,0 @@
1
- import type { DatasetChanges, QuadMatch } from "@ldo/rdf-utils";
2
- import type { Quad } from "@rdfjs/types";
3
- export declare class UpdateManager {
4
- private quadMatchListenerMap;
5
- private listenerHashMap;
6
- registerListener(quadMatch: QuadMatch, callback: () => void): void;
7
- removeListener(callback: () => void): void;
8
- notifyListenersOfChanges(changes: DatasetChanges<Quad>): void;
9
- }