@ldo/svelte 1.0.0-alpha.11 → 1.0.0-alpha.13
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 +74 -0
- package/dist/cjs/createLdoSvelteMethods.js +74 -0
- package/dist/cjs/createLdoSvelteMethods.js.map +1 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/methods/useLdo.js +59 -0
- package/dist/cjs/methods/useLdo.js.map +1 -0
- package/dist/cjs/methods/useLinkQuery.js +36 -0
- package/dist/cjs/methods/useLinkQuery.js.map +1 -0
- package/dist/cjs/methods/useMatchObject.js +22 -0
- package/dist/cjs/methods/useMatchObject.js.map +1 -0
- package/dist/cjs/methods/useMatchSubject.js +22 -0
- package/dist/cjs/methods/useMatchSubject.js.map +1 -0
- package/dist/cjs/methods/useResource.js +51 -0
- package/dist/cjs/methods/useResource.js.map +1 -0
- package/dist/cjs/methods/useSubject.js +24 -0
- package/dist/cjs/methods/useSubject.js.map +1 -0
- package/dist/cjs/methods/useSubscribeToResource.js +17 -0
- package/dist/cjs/methods/useSubscribeToResource.js.map +1 -0
- package/dist/cjs/util/useTrackingProxy.js +37 -0
- package/dist/cjs/util/useTrackingProxy.js.map +1 -0
- package/dist/esm/createLdoSvelteMethods.js +71 -0
- package/dist/esm/createLdoSvelteMethods.js.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/methods/useLdo.js +56 -0
- package/dist/esm/methods/useLdo.js.map +1 -0
- package/dist/esm/methods/useLinkQuery.js +33 -0
- package/dist/esm/methods/useLinkQuery.js.map +1 -0
- package/dist/esm/methods/useMatchObject.js +19 -0
- package/dist/esm/methods/useMatchObject.js.map +1 -0
- package/dist/esm/methods/useMatchSubject.js +19 -0
- package/dist/esm/methods/useMatchSubject.js.map +1 -0
- package/dist/esm/methods/useResource.js +48 -0
- package/dist/esm/methods/useResource.js.map +1 -0
- package/dist/esm/methods/useSubject.js +21 -0
- package/dist/esm/methods/useSubject.js.map +1 -0
- package/dist/esm/methods/useSubscribeToResource.js +14 -0
- package/dist/esm/methods/useSubscribeToResource.js.map +1 -0
- package/dist/esm/util/useTrackingProxy.js +34 -0
- package/dist/esm/util/useTrackingProxy.js.map +1 -0
- package/dist/types/createLdoSvelteMethods.d.ts +59 -0
- package/dist/types/createLdoSvelteMethods.d.ts.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/{src → types}/methods/useLdo.d.ts +4 -5
- package/dist/{src → types}/methods/useLdo.d.ts.map +1 -1
- package/dist/types/methods/useLinkQuery.d.ts +11 -0
- package/dist/types/methods/useLinkQuery.d.ts.map +1 -0
- package/dist/{src → types}/methods/useMatchObject.d.ts +5 -5
- package/dist/types/methods/useMatchObject.d.ts.map +1 -0
- package/dist/{src → types}/methods/useMatchSubject.d.ts +5 -5
- package/dist/types/methods/useMatchSubject.d.ts.map +1 -0
- package/dist/{src → types}/methods/useResource.d.ts +2 -3
- package/dist/{src → types}/methods/useSubject.d.ts +5 -5
- package/dist/{src → types}/methods/useSubscribeToResource.d.ts +1 -2
- package/dist/{src → types}/util/useTrackingProxy.d.ts +3 -3
- package/dist/{src → types}/util/useTrackingProxy.d.ts.map +1 -1
- package/package.json +22 -13
- package/src/createLdoSvelteMethods.tsx +7 -7
- package/src/methods/useLdo.ts +66 -66
- package/src/methods/useLinkQuery.ts +34 -9
- package/src/methods/useMatchObject.ts +9 -3
- package/src/methods/useMatchSubject.ts +9 -3
- package/src/methods/useSubscribeToResource.ts +1 -1
- package/src/util/useTrackingProxy.ts +5 -0
- package/dist/example/src/ldoSvelteMethods.d.ts +0 -2
- package/dist/example/src/ldoSvelteMethods.d.ts.map +0 -1
- package/dist/example/src/main.d.ts +0 -5
- package/dist/example/src/main.d.ts.map +0 -1
- package/dist/index.cjs +0 -2
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +0 -88
- package/dist/index.mjs.map +0 -1
- package/dist/src/index.d.ts +0 -9
- package/dist/src/methods/useLinkQuery.d.ts +0 -11
- package/dist/src/methods/useLinkQuery.d.ts.map +0 -1
- package/dist/src/methods/useMatchObject.d.ts.map +0 -1
- package/dist/src/methods/useMatchSubject.d.ts.map +0 -1
- package/dist/vite.config.d.ts +0 -3
- package/dist/vite.config.d.ts.map +0 -1
- package/dist/vite.config.example.d.ts +0 -3
- package/dist/vite.config.example.d.ts.map +0 -1
- /package/dist/{src → types}/index.d.ts.map +0 -0
- /package/dist/{src → types}/methods/useResource.d.ts.map +0 -0
- /package/dist/{src → types}/methods/useSubject.d.ts.map +0 -0
- /package/dist/{src → types}/methods/useSubscribeToResource.d.ts.map +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.js";
|
|
2
|
+
import { onDestroy } from "svelte";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*
|
|
6
|
+
* Creates a useMatchSubject function.
|
|
7
|
+
*/
|
|
8
|
+
export function createUseLinkQuery(dataset) {
|
|
9
|
+
/**
|
|
10
|
+
* Returns an array of matching linked data objects. Triggers a rerender if
|
|
11
|
+
* the data is updated.
|
|
12
|
+
*/
|
|
13
|
+
return function useQueryLink(shapeType, startingResource, startingSubject, linkQuery) {
|
|
14
|
+
const resource = dataset.getResource(startingResource);
|
|
15
|
+
console.log(resource);
|
|
16
|
+
const lq = dataset
|
|
17
|
+
.usingType(shapeType)
|
|
18
|
+
.startLinkQuery(resource, startingSubject, linkQuery);
|
|
19
|
+
console.log("Calling subscribe");
|
|
20
|
+
lq.subscribe();
|
|
21
|
+
console.log("After call subscribe");
|
|
22
|
+
onDestroy(() => {
|
|
23
|
+
lq.unsubscribeAll();
|
|
24
|
+
});
|
|
25
|
+
const fromSubject = (builder) => {
|
|
26
|
+
if (!startingSubject)
|
|
27
|
+
return;
|
|
28
|
+
return builder.fromSubject(startingSubject);
|
|
29
|
+
};
|
|
30
|
+
return useTrackingProxy(shapeType, fromSubject, dataset);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=useLinkQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkQuery.js","sourceRoot":"","sources":["../../../src/methods/useLinkQuery.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAqC;IAErC;;;OAGG;IACH,OAAO,SAAS,YAAY,CAI1B,SAA0B,EAC1B,gBAAwB,EACxB,eAAqC,EACrC,SAAqB;QAErB,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtB,MAAM,EAAE,GAAG,OAAO;aACf,SAAS,CAAC,SAAS,CAAC;aACpB,cAAc,CAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjC,EAAE,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAEpC,SAAS,CAAC,GAAG,EAAE;YACb,EAAE,CAAC,cAAc,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,CAAC,OAAyB,EAAE,EAAE;YAChD,IAAI,CAAC,eAAe;gBAAE,OAAO;YAC7B,OAAO,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAC9C,CAAC,CAAC;QAEF,OAAO,gBAAgB,CACrB,SAAS,EACT,WAAW,EACX,OAAO,CACuD,CAAC;IACnE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Creates a useMatchObject function
|
|
6
|
+
*/
|
|
7
|
+
export function createUseMatchObject(dataset) {
|
|
8
|
+
/**
|
|
9
|
+
* Returns an array of matching items and triggers a rerender when that data
|
|
10
|
+
* is updated.
|
|
11
|
+
*/
|
|
12
|
+
return function useMatchObject(shapeType, subject, predicate, graph) {
|
|
13
|
+
const matchObject = (builder) => {
|
|
14
|
+
return builder.matchObject(subject, predicate, graph);
|
|
15
|
+
};
|
|
16
|
+
return useTrackingProxy(shapeType, matchObject, dataset);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=useMatchObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchObject.js","sourceRoot":"","sources":["../../../src/methods/useMatchObject.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAqC;IAErC;;;OAGG;IACH,OAAO,SAAS,cAAc,CAC5B,SAA0B,EAC1B,OAA+B,EAC/B,SAAiC,EACjC,KAA6B;QAE7B,MAAM,WAAW,GAAG,CAAC,OAAyB,EAAE,EAAE;YAChD,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,OAAO,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Creates a useMatchSubject function.
|
|
6
|
+
*/
|
|
7
|
+
export function createUseMatchSubject(dataset) {
|
|
8
|
+
/**
|
|
9
|
+
* Returns an array of matching linked data objects. Triggers a rerender if
|
|
10
|
+
* the data is updated.
|
|
11
|
+
*/
|
|
12
|
+
return function useMatchSubject(shapeType, predicate, object, graph) {
|
|
13
|
+
const matchSubject = (builder) => {
|
|
14
|
+
return builder.matchSubject(predicate, object, graph);
|
|
15
|
+
};
|
|
16
|
+
return useTrackingProxy(shapeType, matchSubject, dataset);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=useMatchSubject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchSubject.js","sourceRoot":"","sources":["../../../src/methods/useMatchSubject.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAqC;IAErC;;;OAGG;IACH,OAAO,SAAS,eAAe,CAC7B,SAA0B,EAC1B,SAAiC,EACjC,MAA8B,EAC9B,KAA6B;QAE7B,MAAM,YAAY,GAAG,CAAC,OAAyB,EAAE,EAAE;YACjD,OAAO,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF,OAAO,gBAAgB,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Creates a useResource function.
|
|
6
|
+
*/
|
|
7
|
+
export function createUseResource(dataset) {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a resource and triggers a rerender if that resource is updated.
|
|
10
|
+
*/
|
|
11
|
+
return function useResource(uri, options) {
|
|
12
|
+
let resource;
|
|
13
|
+
// Get the resource based on incoming data
|
|
14
|
+
if (uri) {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
resource = dataset.getResource(uri);
|
|
17
|
+
// Run read operations if necissary
|
|
18
|
+
if (!options?.suppressInitialRead) {
|
|
19
|
+
if (options?.reloadOnMount) {
|
|
20
|
+
resource.read();
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
resource.readIfUnfetched();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
resource = undefined;
|
|
29
|
+
}
|
|
30
|
+
// The Svelte store
|
|
31
|
+
const store = writable(resource, (set) => {
|
|
32
|
+
const onResourceUpdate = () => {
|
|
33
|
+
set(resource);
|
|
34
|
+
};
|
|
35
|
+
if (resource) {
|
|
36
|
+
resource.on("update", onResourceUpdate);
|
|
37
|
+
// TODO: handle subscriptions
|
|
38
|
+
return () => {
|
|
39
|
+
resource.off("update", onResourceUpdate);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
subscribe: store.subscribe,
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=useResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResource.js","sourceRoot":"","sources":["../../../src/methods/useResource.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAiB,MAAM,cAAc,CAAC;AA4BvD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAqC;IAErC;;OAEG;IACH,OAAO,SAAS,WAAW,CAKzB,GAAa,EACb,OAAkC;QAElC,IAAI,QAA4D,CAAC;QACjE,0CAA0C;QAC1C,IAAI,GAAG,EAAE,CAAC;YACR,8DAA8D;YAC9D,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAQ,CAAC;YAC3C,mCAAmC;YACnC,IAAI,CAAC,OAAO,EAAE,mBAAmB,EAAE,CAAC;gBAClC,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;oBAC3B,QAAS,CAAC,IAAI,EAAE,CAAC;gBACnB,CAAC;qBAAM,CAAC;oBACN,QAAS,CAAC,eAAe,EAAE,CAAC;gBAC9B,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,SAAS,CAAC;QACvB,CAAC;QAED,mBAAmB;QACnB,MAAM,KAAK,GAAG,QAAQ,CACpB,QAAQ,EACR,CAAC,GAAG,EAAE,EAAE;YACN,MAAM,gBAAgB,GAAG,GAAG,EAAE;gBAC5B,GAAG,CAAC,QAAQ,CAAC,CAAC;YAChB,CAAC,CAAC;YAEF,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBAExC,6BAA6B;gBAE7B,OAAO,GAAG,EAAE;oBACV,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBAC3C,CAAC,CAAC;YACJ,CAAC;QACH,CAAC,CACF,CAAC;QAEF,OAAO;YACL,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.js";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Creates a useSubject function.
|
|
6
|
+
*/
|
|
7
|
+
export function createUseSubject(dataset) {
|
|
8
|
+
/**
|
|
9
|
+
* Returns a Linked Data Object based on the provided subject. Triggers a
|
|
10
|
+
* rerender if the data is udpated.
|
|
11
|
+
*/
|
|
12
|
+
return function useSubject(shapeType, subject) {
|
|
13
|
+
const fromSubject = (builder) => {
|
|
14
|
+
if (!subject)
|
|
15
|
+
return;
|
|
16
|
+
return builder.fromSubject(subject);
|
|
17
|
+
};
|
|
18
|
+
return useTrackingProxy(shapeType, fromSubject, dataset);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=useSubject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubject.js","sourceRoot":"","sources":["../../../src/methods/useSubject.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAmB/D;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAqC;IAErC;;;OAGG;IACH,OAAO,SAAS,UAAU,CACxB,SAA0B,EAC1B,OAA8B;QAE9B,MAAM,WAAW,GAAG,CAAC,OAAyB,EAAE,EAAE;YAChD,IAAI,CAAC,OAAO;gBAAE,OAAO;YACrB,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC;QAEF,OAAO,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*
|
|
4
|
+
* Creates a useSubscribeToResource function.
|
|
5
|
+
*/
|
|
6
|
+
export function createUseSubscribeToResource(dataset) {
|
|
7
|
+
/**
|
|
8
|
+
* Starts a subscription to a resource.
|
|
9
|
+
*/
|
|
10
|
+
return function useSubscribeToResource(...uris) {
|
|
11
|
+
throw new Error("Subscribe to Resource is Not Implemented for Svelte");
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=useSubscribeToResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubscribeToResource.js","sourceRoot":"","sources":["../../../src/methods/useSubscribeToResource.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAAqC;IAErC;;OAEG;IACH,OAAO,SAAS,sBAAsB,CAAC,GAAG,IAAc;QACtD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACzE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createTrackingProxyBuilder } from "@ldo/connected";
|
|
2
|
+
import { writable } from "svelte/store";
|
|
3
|
+
import { onDestroy } from "svelte";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*
|
|
7
|
+
* A hook for tracking proxies
|
|
8
|
+
*/
|
|
9
|
+
export function useTrackingProxy(shapeType, createLdo, dataset) {
|
|
10
|
+
const forceUpdateInfo = {};
|
|
11
|
+
const forceUpdate = () => {
|
|
12
|
+
dataset.removeListenerFromAllEvents(forceUpdate);
|
|
13
|
+
const builder = createTrackingProxyBuilder(dataset, shapeType, forceUpdate);
|
|
14
|
+
const linkedDataObject = createLdo(builder);
|
|
15
|
+
forceUpdateInfo.ldo = linkedDataObject;
|
|
16
|
+
if (forceUpdateInfo.set && forceUpdateInfo.ldo)
|
|
17
|
+
forceUpdateInfo.set(forceUpdateInfo.ldo);
|
|
18
|
+
};
|
|
19
|
+
forceUpdate({}, "", [undefined, undefined, undefined, undefined]);
|
|
20
|
+
// The Svelte store
|
|
21
|
+
const store = writable(forceUpdateInfo.ldo, (set) => {
|
|
22
|
+
forceUpdateInfo.set = set;
|
|
23
|
+
return () => {
|
|
24
|
+
dataset.removeListenerFromAllEvents(forceUpdate);
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
onDestroy(() => {
|
|
28
|
+
dataset.removeListenerFromAllEvents(forceUpdate);
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
subscribe: store.subscribe,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=useTrackingProxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTrackingProxy.js","sourceRoot":"","sources":["../../../src/util/useTrackingProxy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAiB,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAA0B,EAC1B,SAAoD,EACpD,OAAmB;IAEnB,MAAM,eAAe,GAGjB,EAAE,CAAC;IAEP,MAAM,WAAW,GAAsB,GAAG,EAAE;QAC1C,OAAO,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,0BAA0B,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAC5E,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAC5C,eAAe,CAAC,GAAG,GAAG,gBAAgB,CAAC;QACvC,IAAI,eAAe,CAAC,GAAG,IAAI,eAAe,CAAC,GAAG;YAC5C,eAAe,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC;IACF,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAElE,mBAAmB;IACnB,MAAM,KAAK,GAAG,QAAQ,CAAa,eAAe,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QAC9D,eAAe,CAAC,GAAG,GAAG,GAAG,CAAC;QAE1B,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ConnectedPlugin } from "@ldo/connected";
|
|
2
|
+
/**
|
|
3
|
+
* A function that creates all common react functions given specific plugin.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* `methods.ts`
|
|
7
|
+
* ```tyepscript
|
|
8
|
+
* import { solidConnectedPlugin } from "@ldo/connected-solid";
|
|
9
|
+
* import { nextGraphConnectedPlugin } from "@ldo/connected-nextgraph";
|
|
10
|
+
* import { createLdoReactMethods } from "@ldo/react";
|
|
11
|
+
*
|
|
12
|
+
* // Export the results to be used in the reset of the application
|
|
13
|
+
* export const {
|
|
14
|
+
* dataset,
|
|
15
|
+
* useLdo,
|
|
16
|
+
* useMatchObject,
|
|
17
|
+
* useMatchSubject,
|
|
18
|
+
* useResource,
|
|
19
|
+
* useSubject,
|
|
20
|
+
* useSubscribeToResource,
|
|
21
|
+
* useLinkQuery,
|
|
22
|
+
* } = createLdoReactMethods([
|
|
23
|
+
* solidConnectedPlugin,
|
|
24
|
+
* nextGraphConnectedPlugin
|
|
25
|
+
* ]);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* `App.tsx`
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import react, { FunctionComponent } from "react";
|
|
31
|
+
* import { PostShShapeType } from "./.ldo/posts.shapeType.ts";
|
|
32
|
+
* import { useResource, useSubject } from "./methods.ts";
|
|
33
|
+
*
|
|
34
|
+
* const UseSubjectTest: FunctionComponent = () => {
|
|
35
|
+
* const resource = useResource(SAMPLE_DATA_URI);
|
|
36
|
+
* const post = useSubject(PostShShapeType, `${SAMPLE_DATA_URI}#Post1`);
|
|
37
|
+
* if (resource.isLoading() || !post) return <p>loading</p>;
|
|
38
|
+
*
|
|
39
|
+
* return (
|
|
40
|
+
* <ul>
|
|
41
|
+
* {post.publisher.map((publisher) => {
|
|
42
|
+
* return <li key={publisher["@id"]}>{publisher["@id"]}</li>;
|
|
43
|
+
* })}
|
|
44
|
+
* </ul>
|
|
45
|
+
* );
|
|
46
|
+
* };
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function createLdoSvelteMethods<Plugins extends ConnectedPlugin<any, any, any, any>[]>(plugins: Plugins): {
|
|
50
|
+
dataset: import("@ldo/connected").ConnectedLdoDataset<Plugins>;
|
|
51
|
+
useLdo: () => import("./methods/useLdo.js").UseLdoMethods<Plugins>;
|
|
52
|
+
useMatchObject: <Type extends import("@ldo/ldo").LdoBase>(shapeType: import("@ldo/ldo").ShapeType<Type>, subject?: import("@ldo/rdf-utils").QuadMatch[0] | string, predicate?: import("@ldo/rdf-utils").QuadMatch[1] | string, graph?: import("@ldo/rdf-utils").QuadMatch[3] | string) => import("svelte/store").Readable<import("@ldo/jsonld-dataset-proxy").LdSet<Type>>;
|
|
53
|
+
useMatchSubject: <Type extends import("@ldo/ldo").LdoBase>(shapeType: import("@ldo/ldo").ShapeType<Type>, predicate?: import("@ldo/rdf-utils").QuadMatch[1] | string, object?: import("@ldo/rdf-utils").QuadMatch[2] | string, graph?: import("@ldo/rdf-utils").QuadMatch[3] | string) => import("svelte/store").Readable<import("@ldo/jsonld-dataset-proxy").LdSet<Type>>;
|
|
54
|
+
useResource: import("./methods/useResource.js").useResourceType<Plugins>;
|
|
55
|
+
useSubject: import("./methods/useSubject.js").useSubjectType;
|
|
56
|
+
useSubscribeToResource: (...uris: string[]) => void;
|
|
57
|
+
useLinkQuery: <Type extends import("@ldo/ldo").LdoBase, QueryInput extends Partial<{ [key in Exclude<keyof Type, "@context">]: import("@ldo/connected").LQInputFlattenSet<Type[key]>; }>>(shapeType: import("@ldo/ldo").ShapeType<Type>, startingResource: string, startingSubject: import("@ldo/rdf-utils").SubjectNode | string, linkQuery: QueryInput) => import("svelte/store").Readable<import("@ldo/connected").ExpandDeep<import("@ldo/connected").LQReturn<Type, QueryInput>> | undefined>;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=createLdoSvelteMethods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLdoSvelteMethods.d.ts","sourceRoot":"","sources":["../../src/createLdoSvelteMethods.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAQxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,EACrD,OAAO,EAAE,OAAO;;;;;;;;;EAcjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./createLdoSvelteMethods.js";
|
|
2
|
+
export * from "./methods/useLdo.js";
|
|
3
|
+
export * from "./methods/useMatchObject.js";
|
|
4
|
+
export * from "./methods/useMatchSubject.js";
|
|
5
|
+
export * from "./methods/useResource.js";
|
|
6
|
+
export * from "./methods/useSubject.js";
|
|
7
|
+
export * from "./methods/useSubscribeToResource.js";
|
|
8
|
+
export * from "./methods/useLinkQuery.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ConnectedLdoDataset, ConnectedLdoTransactionDataset, ConnectedPlugin } from
|
|
2
|
-
import { LdoBase, ShapeType } from
|
|
3
|
-
import { SubjectNode } from
|
|
4
|
-
|
|
1
|
+
import { type ConnectedLdoDataset, type ConnectedLdoTransactionDataset, type ConnectedPlugin } from "@ldo/connected";
|
|
2
|
+
import { type LdoBase, type ShapeType } from "@ldo/ldo";
|
|
3
|
+
import type { SubjectNode } from "@ldo/rdf-utils";
|
|
5
4
|
/**
|
|
6
5
|
* The methods returned by useLdo
|
|
7
6
|
*/
|
|
@@ -56,5 +55,5 @@ export interface UseLdoMethods<Plugins extends ConnectedPlugin[]> {
|
|
|
56
55
|
* @internal
|
|
57
56
|
* Creates the useLdoHook
|
|
58
57
|
*/
|
|
59
|
-
export declare function createUseLdo<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>):
|
|
58
|
+
export declare function createUseLdo<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): () => UseLdoMethods<Plugins>;
|
|
60
59
|
//# sourceMappingURL=useLdo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLdo.d.ts","sourceRoot":"","sources":["../../../src/methods/useLdo.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"useLdo.d.ts","sourceRoot":"","sources":["../../../src/methods/useLdo.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,OAAO,SAAS,eAAe,EAAE;IAC9D;;OAEG;IACH,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtC;;;;;;;;;;OAUG;IACH,WAAW,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;IACzD;;;;;OAKG;IACH,UAAU,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC;IACvD;;OAEG;IACH,UAAU,CAAC,IAAI,SAAS,OAAO,EAC7B,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,EAC1B,OAAO,EAAE,MAAM,GAAG,WAAW,GAC5B,IAAI,CAAC;IACR;;;;;;;;OAQG;IACH,UAAU,CAAC,IAAI,SAAS,OAAO,EAC7B,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,EAC1B,OAAO,EAAE,MAAM,GAAG,WAAW,EAC7B,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,EAC9C,GAAG,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,EAAE,GAC7D,IAAI,CAAC;IACR;;OAEG;IACH,UAAU,CAAC,IAAI,SAAS,OAAO,EAC7B,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,EAC9C,GAAG,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,EAAE,GAC7D,IAAI,CAAC;IACR;;OAEG;IACH,UAAU,CACR,KAAK,EAAE,OAAO,GACb,UAAU,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;CAC1E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,SAAS,eAAe,EAAE,EAC5D,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,SA+DX,aAAa,CAAC,OAAO,CAAC,CAGjD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ConnectedLdoDataset, type ConnectedPlugin, type ExpandDeep, type LQInput, type LQReturn } from "@ldo/connected";
|
|
2
|
+
import { type LdoBase, type ShapeType } from "@ldo/ldo";
|
|
3
|
+
import type { SubjectNode } from "@ldo/rdf-utils";
|
|
4
|
+
import { type Readable } from "svelte/store";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*
|
|
8
|
+
* Creates a useMatchSubject function.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createUseLinkQuery<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): <Type extends LdoBase, QueryInput extends LQInput<Type>>(shapeType: ShapeType<Type>, startingResource: string, startingSubject: SubjectNode | string, linkQuery: QueryInput) => Readable<ExpandDeep<LQReturn<Type, QueryInput>> | undefined>;
|
|
11
|
+
//# sourceMappingURL=useLinkQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkQuery.d.ts","sourceRoot":"","sources":["../../../src/methods/useLinkQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,KAAK,QAAQ,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,eAAe,EAAE,EAClE,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,IAOnC,IAAI,SAAS,OAAO,EACpB,UAAU,SAAS,OAAO,CAAC,IAAI,CAAC,EAEhC,WAAW,SAAS,CAAC,IAAI,CAAC,EAC1B,kBAAkB,MAAM,EACxB,iBAAiB,WAAW,GAAG,MAAM,EACrC,WAAW,UAAU,KACpB,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,SAAS,CAAC,CAyBhE"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LdoBase, LdSet, ShapeType } from
|
|
2
|
-
import { QuadMatch } from
|
|
3
|
-
import { ConnectedLdoDataset, ConnectedPlugin } from
|
|
4
|
-
|
|
1
|
+
import type { LdoBase, LdSet, ShapeType } from "@ldo/ldo";
|
|
2
|
+
import type { QuadMatch } from "@ldo/rdf-utils";
|
|
3
|
+
import type { ConnectedLdoDataset, ConnectedPlugin } from "@ldo/connected";
|
|
4
|
+
import type { Readable } from "svelte/store";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*
|
|
8
8
|
* Creates a useMatchObject function
|
|
9
9
|
*/
|
|
10
|
-
export declare function createUseMatchObject<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): <Type extends LdoBase>(shapeType: ShapeType<Type>, subject?: QuadMatch[0] | string, predicate?: QuadMatch[1] | string, graph?: QuadMatch[3] | string) => LdSet<Type
|
|
10
|
+
export declare function createUseMatchObject<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): <Type extends LdoBase>(shapeType: ShapeType<Type>, subject?: QuadMatch[0] | string, predicate?: QuadMatch[1] | string, graph?: QuadMatch[3] | string) => Readable<LdSet<Type>>;
|
|
11
11
|
//# sourceMappingURL=useMatchObject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchObject.d.ts","sourceRoot":"","sources":["../../../src/methods/useMatchObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAc,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,SAAS,eAAe,EAAE,EACpE,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,IAMN,IAAI,SAAS,OAAO,EACjD,WAAW,SAAS,CAAC,IAAI,CAAC,EAC1B,UAAU,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,EAC/B,YAAY,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,EACjC,QAAQ,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,KAC5B,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAOzB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { LdoBase, LdSet, ShapeType } from
|
|
2
|
-
import { QuadMatch } from
|
|
3
|
-
import { ConnectedLdoDataset, ConnectedPlugin } from
|
|
4
|
-
|
|
1
|
+
import type { LdoBase, LdSet, ShapeType } from "@ldo/ldo";
|
|
2
|
+
import type { QuadMatch } from "@ldo/rdf-utils";
|
|
3
|
+
import type { ConnectedLdoDataset, ConnectedPlugin } from "@ldo/connected";
|
|
4
|
+
import type { Readable } from "svelte/store";
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*
|
|
8
8
|
* Creates a useMatchSubject function.
|
|
9
9
|
*/
|
|
10
|
-
export declare function createUseMatchSubject<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): <Type extends LdoBase>(shapeType: ShapeType<Type>, predicate?: QuadMatch[1] | string, object?: QuadMatch[2] | string, graph?: QuadMatch[3] | string) => LdSet<Type
|
|
10
|
+
export declare function createUseMatchSubject<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): <Type extends LdoBase>(shapeType: ShapeType<Type>, predicate?: QuadMatch[1] | string, object?: QuadMatch[2] | string, graph?: QuadMatch[3] | string) => Readable<LdSet<Type>>;
|
|
11
11
|
//# sourceMappingURL=useMatchSubject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchSubject.d.ts","sourceRoot":"","sources":["../../../src/methods/useMatchSubject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAc,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,eAAe,EAAE,EACrE,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,IAML,IAAI,SAAS,OAAO,EAClD,WAAW,SAAS,CAAC,IAAI,CAAC,EAC1B,YAAY,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,EACjC,SAAS,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,EAC9B,QAAQ,SAAS,CAAC,CAAC,CAAC,GAAG,MAAM,KAC5B,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAOzB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ConnectedLdoDataset, ConnectedPlugin, GetResourceReturnType } from
|
|
2
|
-
import { Readable } from
|
|
3
|
-
|
|
1
|
+
import type { ConnectedLdoDataset, ConnectedPlugin, GetResourceReturnType } from "@ldo/connected";
|
|
2
|
+
import { type Readable } from "svelte/store";
|
|
4
3
|
export interface UseResourceOptions<Name> {
|
|
5
4
|
pluginName?: Name;
|
|
6
5
|
suppressInitialRead?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SubjectNode } from
|
|
2
|
-
import { ShapeType
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import type { SubjectNode } from "@ldo/rdf-utils";
|
|
2
|
+
import type { ShapeType } from "@ldo/ldo";
|
|
3
|
+
import type { LdoBase } from "@ldo/ldo";
|
|
4
|
+
import type { ConnectedLdoDataset, ConnectedPlugin } from "@ldo/connected";
|
|
5
|
+
import type { Readable } from "svelte/store";
|
|
6
6
|
export type useSubjectType = {
|
|
7
7
|
<Type extends LdoBase>(shapeType: ShapeType<Type>, subject: string | SubjectNode): Readable<Type>;
|
|
8
8
|
<Type extends LdoBase>(shapeType: ShapeType<Type>, subject?: string | SubjectNode): Readable<Type | undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LdoBuilder
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { LdoBuilder } from "@ldo/ldo";
|
|
2
|
+
import type { LdoBase, LdoDataset, ShapeType } from "@ldo/ldo";
|
|
3
|
+
import { type Readable } from "svelte/store";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTrackingProxy.d.ts","sourceRoot":"","sources":["../../../src/util/useTrackingProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useTrackingProxy.d.ts","sourceRoot":"","sources":["../../../src/util/useTrackingProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIvD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,OAAO,EAAE,UAAU,EAC/D,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,EAC1B,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,UAAU,EACpD,OAAO,EAAE,UAAU,GAClB,QAAQ,CAAC,UAAU,CAAC,CAgCtB"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/svelte",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.13",
|
|
4
4
|
"description": "A Svelte library for LDO.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.mjs",
|
|
7
|
-
"svelte": "src/index.ts",
|
|
8
|
-
"types": "dist/index.d.ts",
|
|
9
5
|
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"svelte": "src/index.ts",
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"require": "./dist/cjs/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
10
18
|
"scripts": {
|
|
11
19
|
"dev": "concurrently \"npm run dev:pod\" \"npm run dev:app\"",
|
|
12
|
-
"dev:pod": "
|
|
20
|
+
"dev:pod": "vite-node ./example/test-server/runServer.ts",
|
|
13
21
|
"dev:app": "vite --config vite.config.example.ts",
|
|
14
|
-
"build": "rimraf dist &&
|
|
15
|
-
"build:
|
|
16
|
-
"
|
|
17
|
-
"test
|
|
22
|
+
"build": "rimraf dist && npm run build:cjs && npm run build:esm",
|
|
23
|
+
"build:cjs": "tsc --project tsconfig.cjs.json",
|
|
24
|
+
"build:esm": "tsc --project tsconfig.esm.json",
|
|
25
|
+
"test": "jest --coverage",
|
|
18
26
|
"lint": "eslint . --ext .js,.ts,.svelte --fix --no-error-on-unmatched-pattern",
|
|
19
27
|
"format": "prettier --write .",
|
|
20
28
|
"prepublishOnly": "npm run build"
|
|
@@ -30,7 +38,7 @@
|
|
|
30
38
|
},
|
|
31
39
|
"homepage": "https://github.com/o-development/ldo/tree/main/packages/svelte#readme",
|
|
32
40
|
"devDependencies": {
|
|
33
|
-
"@ldo/test-solid-server": "^1.0.0-alpha.
|
|
41
|
+
"@ldo/test-solid-server": "^1.0.0-alpha.12",
|
|
34
42
|
"@sveltejs/vite-plugin-svelte": "^2.5.3",
|
|
35
43
|
"@testing-library/jest-dom": "^6.6.3",
|
|
36
44
|
"@testing-library/svelte": "^5.2.7",
|
|
@@ -49,13 +57,14 @@
|
|
|
49
57
|
"tslib": "^2.8.1",
|
|
50
58
|
"typescript": "^5.8.3",
|
|
51
59
|
"vite": "^4.5.0",
|
|
60
|
+
"vite-node": "^3.1.4",
|
|
52
61
|
"vite-plugin-dts": "^3.8.1"
|
|
53
62
|
},
|
|
54
63
|
"peerDependencies": {
|
|
55
64
|
"svelte": "^3.50.0"
|
|
56
65
|
},
|
|
57
66
|
"dependencies": {
|
|
58
|
-
"@ldo/connected": "^1.0.0-alpha.
|
|
67
|
+
"@ldo/connected": "^1.0.0-alpha.12",
|
|
59
68
|
"@ldo/jsonld-dataset-proxy": "^1.0.0-alpha.11",
|
|
60
69
|
"@ldo/ldo": "^1.0.0-alpha.11",
|
|
61
70
|
"@ldo/rdf-utils": "^1.0.0-alpha.11",
|
|
@@ -70,5 +79,5 @@
|
|
|
70
79
|
"publishConfig": {
|
|
71
80
|
"access": "public"
|
|
72
81
|
},
|
|
73
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "c40bc32e1ce52208754d2798f41113c3db36284f"
|
|
74
83
|
}
|
|
@@ -66,12 +66,12 @@ export function createLdoSvelteMethods<
|
|
|
66
66
|
|
|
67
67
|
return {
|
|
68
68
|
dataset,
|
|
69
|
-
useLdo: createUseLdo(dataset),
|
|
70
|
-
useMatchObject: createUseMatchObject(dataset),
|
|
71
|
-
useMatchSubject: createUseMatchSubject(dataset),
|
|
72
|
-
useResource: createUseResource(dataset),
|
|
73
|
-
useSubject: createUseSubject(dataset),
|
|
74
|
-
useSubscribeToResource: createUseSubscribeToResource(dataset),
|
|
75
|
-
useLinkQuery: createUseLinkQuery(dataset),
|
|
69
|
+
useLdo: createUseLdo<Plugins>(dataset),
|
|
70
|
+
useMatchObject: createUseMatchObject<Plugins>(dataset),
|
|
71
|
+
useMatchSubject: createUseMatchSubject<Plugins>(dataset),
|
|
72
|
+
useResource: createUseResource<Plugins>(dataset),
|
|
73
|
+
useSubject: createUseSubject<Plugins>(dataset),
|
|
74
|
+
useSubscribeToResource: createUseSubscribeToResource<Plugins>(dataset),
|
|
75
|
+
useLinkQuery: createUseLinkQuery<Plugins>(dataset),
|
|
76
76
|
};
|
|
77
77
|
}
|