@ldo/svelte 1.0.0-alpha.38 → 1.0.0-alpha.43
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 +0 -1
- package/dist/createLdoSvelteMethods.cjs +17 -20
- package/dist/createLdoSvelteMethods.d.cts +0 -2
- package/dist/createLdoSvelteMethods.d.cts.map +1 -1
- package/dist/{createLdoSvelteMethods.d.ts → createLdoSvelteMethods.d.mts} +2 -4
- package/dist/createLdoSvelteMethods.d.mts.map +1 -0
- package/dist/{createLdoSvelteMethods.js → createLdoSvelteMethods.mjs} +9 -10
- package/dist/createLdoSvelteMethods.mjs.map +1 -0
- package/dist/index.cjs +17 -17
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +9 -0
- package/dist/methods/useLdo.cjs +5 -9
- package/dist/methods/useLdo.d.cts +0 -2
- package/dist/methods/useLdo.d.cts.map +1 -1
- package/dist/methods/{useLdo.d.ts → useLdo.d.mts} +2 -4
- package/dist/methods/useLdo.d.mts.map +1 -0
- package/dist/methods/{useLdo.js → useLdo.mjs} +3 -5
- package/dist/methods/useLdo.mjs.map +1 -0
- package/dist/methods/useLinkQuery.cjs +4 -7
- package/dist/methods/useLinkQuery.d.cts +0 -3
- package/dist/methods/useLinkQuery.d.cts.map +1 -1
- package/dist/methods/{useLinkQuery.d.ts → useLinkQuery.d.mts} +2 -5
- package/dist/methods/useLinkQuery.d.mts.map +1 -0
- package/dist/methods/{useLinkQuery.js → useLinkQuery.mjs} +3 -4
- package/dist/methods/useLinkQuery.mjs.map +1 -0
- package/dist/methods/useMatchObject.cjs +3 -5
- package/dist/methods/useMatchObject.d.cts +0 -3
- package/dist/methods/useMatchObject.d.cts.map +1 -1
- package/dist/methods/{useMatchObject.d.ts → useMatchObject.d.mts} +2 -5
- package/dist/methods/useMatchObject.d.mts.map +1 -0
- package/dist/methods/{useMatchObject.js → useMatchObject.mjs} +3 -4
- package/dist/methods/useMatchObject.mjs.map +1 -0
- package/dist/methods/useMatchSubject.cjs +3 -5
- package/dist/methods/useMatchSubject.d.cts +0 -3
- package/dist/methods/useMatchSubject.d.cts.map +1 -1
- package/dist/methods/{useMatchSubject.d.ts → useMatchSubject.d.mts} +2 -5
- package/dist/methods/useMatchSubject.d.mts.map +1 -0
- package/dist/methods/{useMatchSubject.js → useMatchSubject.mjs} +3 -4
- package/dist/methods/useMatchSubject.mjs.map +1 -0
- package/dist/methods/useResource.cjs +4 -8
- package/dist/methods/useResource.d.cts +0 -2
- package/dist/methods/useResource.d.cts.map +1 -1
- package/dist/methods/{useResource.d.ts → useResource.d.mts} +2 -4
- package/dist/methods/useResource.d.mts.map +1 -0
- package/dist/methods/{useResource.js → useResource.mjs} +4 -6
- package/dist/methods/useResource.mjs.map +1 -0
- package/dist/methods/useSubject.cjs +3 -5
- package/dist/methods/useSubject.d.cts +0 -2
- package/dist/methods/useSubject.d.cts.map +1 -1
- package/dist/methods/{useSubject.d.ts → useSubject.d.mts} +2 -4
- package/dist/methods/useSubject.d.mts.map +1 -0
- package/dist/methods/{useSubject.js → useSubject.mjs} +3 -4
- package/dist/methods/{useSubject.js.map → useSubject.mjs.map} +1 -1
- package/dist/methods/useSubscribeToResource.cjs +1 -3
- package/dist/methods/useSubscribeToResource.d.cts +0 -3
- package/dist/methods/useSubscribeToResource.d.cts.map +1 -1
- package/dist/methods/{useSubscribeToResource.d.ts → useSubscribeToResource.d.mts} +2 -5
- package/dist/methods/useSubscribeToResource.d.mts.map +1 -0
- package/dist/methods/{useSubscribeToResource.js → useSubscribeToResource.mjs} +2 -2
- package/dist/methods/useSubscribeToResource.mjs.map +1 -0
- package/dist/util/useTrackingProxy.cjs +5 -10
- package/dist/util/{useTrackingProxy.js → useTrackingProxy.mjs} +3 -6
- package/dist/util/useTrackingProxy.mjs.map +1 -0
- package/package.json +14 -13
- package/dist/_virtual/rolldown_runtime.cjs +0 -30
- package/dist/createLdoSvelteMethods.d.ts.map +0 -1
- package/dist/createLdoSvelteMethods.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -10
- package/dist/methods/useLdo.d.ts.map +0 -1
- package/dist/methods/useLdo.js.map +0 -1
- package/dist/methods/useLinkQuery.d.ts.map +0 -1
- package/dist/methods/useLinkQuery.js.map +0 -1
- package/dist/methods/useMatchObject.d.ts.map +0 -1
- package/dist/methods/useMatchObject.js.map +0 -1
- package/dist/methods/useMatchSubject.d.ts.map +0 -1
- package/dist/methods/useMatchSubject.js.map +0 -1
- package/dist/methods/useResource.d.ts.map +0 -1
- package/dist/methods/useResource.js.map +0 -1
- package/dist/methods/useSubject.d.ts.map +0 -1
- package/dist/methods/useSubscribeToResource.d.ts.map +0 -1
- package/dist/methods/useSubscribeToResource.js.map +0 -1
- package/dist/util/useTrackingProxy.js.map +0 -1
package/Readme.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const __ldo_connected = require_rolldown_runtime.__toESM(require("@ldo/connected"));
|
|
10
|
-
|
|
1
|
+
const require_useLdo = require("./methods/useLdo.cjs");
|
|
2
|
+
const require_useMatchObject = require("./methods/useMatchObject.cjs");
|
|
3
|
+
const require_useMatchSubject = require("./methods/useMatchSubject.cjs");
|
|
4
|
+
const require_useResource = require("./methods/useResource.cjs");
|
|
5
|
+
const require_useSubject = require("./methods/useSubject.cjs");
|
|
6
|
+
const require_useSubscribeToResource = require("./methods/useSubscribeToResource.cjs");
|
|
7
|
+
const require_useLinkQuery = require("./methods/useLinkQuery.cjs");
|
|
8
|
+
let _ldo_connected = require("@ldo/connected");
|
|
11
9
|
//#region src/createLdoSvelteMethods.tsx
|
|
12
10
|
/**
|
|
13
11
|
* A function that creates all common react functions given specific plugin.
|
|
@@ -57,19 +55,18 @@ const __ldo_connected = require_rolldown_runtime.__toESM(require("@ldo/connected
|
|
|
57
55
|
* ```
|
|
58
56
|
*/
|
|
59
57
|
function createLdoSvelteMethods(plugins) {
|
|
60
|
-
const dataset = (0,
|
|
58
|
+
const dataset = (0, _ldo_connected.createConnectedLdoDataset)(plugins);
|
|
61
59
|
dataset.setMaxListeners(1e3);
|
|
62
60
|
return {
|
|
63
61
|
dataset,
|
|
64
|
-
useLdo:
|
|
65
|
-
useMatchObject:
|
|
66
|
-
useMatchSubject:
|
|
67
|
-
useResource:
|
|
68
|
-
useSubject:
|
|
69
|
-
useSubscribeToResource:
|
|
70
|
-
useLinkQuery:
|
|
62
|
+
useLdo: require_useLdo.createUseLdo(dataset),
|
|
63
|
+
useMatchObject: require_useMatchObject.createUseMatchObject(dataset),
|
|
64
|
+
useMatchSubject: require_useMatchSubject.createUseMatchSubject(dataset),
|
|
65
|
+
useResource: require_useResource.createUseResource(dataset),
|
|
66
|
+
useSubject: require_useSubject.createUseSubject(dataset),
|
|
67
|
+
useSubscribeToResource: require_useSubscribeToResource.createUseSubscribeToResource(dataset),
|
|
68
|
+
useLinkQuery: require_useLinkQuery.createUseLinkQuery(dataset)
|
|
71
69
|
};
|
|
72
70
|
}
|
|
73
|
-
|
|
74
71
|
//#endregion
|
|
75
|
-
exports.createLdoSvelteMethods = createLdoSvelteMethods;
|
|
72
|
+
exports.createLdoSvelteMethods = createLdoSvelteMethods;
|
|
@@ -2,7 +2,6 @@ import * as _ldo_connected0 from "@ldo/connected";
|
|
|
2
2
|
import { ConnectedPlugin } from "@ldo/connected";
|
|
3
3
|
|
|
4
4
|
//#region src/createLdoSvelteMethods.d.ts
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* A function that creates all common react functions given specific plugin.
|
|
8
7
|
*
|
|
@@ -60,7 +59,6 @@ declare function createLdoSvelteMethods<Plugins extends ConnectedPlugin<any, any
|
|
|
60
59
|
useSubscribeToResource: any;
|
|
61
60
|
useLinkQuery: any;
|
|
62
61
|
};
|
|
63
|
-
//# sourceMappingURL=createLdoSvelteMethods.d.ts.map
|
|
64
62
|
//#endregion
|
|
65
63
|
export { createLdoSvelteMethods };
|
|
66
64
|
//# sourceMappingURL=createLdoSvelteMethods.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createLdoSvelteMethods.d.cts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"createLdoSvelteMethods.d.cts","names":[],"sources":["../src/createLdoSvelteMethods.tsx"],"mappings":";;;;;;;AA4DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,sBAAA,iBACE,eAAA,uBAAA,CAChB,OAAA,EAAS,OAAA"}
|
|
@@ -2,7 +2,6 @@ import * as _ldo_connected0 from "@ldo/connected";
|
|
|
2
2
|
import { ConnectedPlugin } from "@ldo/connected";
|
|
3
3
|
|
|
4
4
|
//#region src/createLdoSvelteMethods.d.ts
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* A function that creates all common react functions given specific plugin.
|
|
8
7
|
*
|
|
@@ -60,7 +59,6 @@ declare function createLdoSvelteMethods<Plugins extends ConnectedPlugin<any, any
|
|
|
60
59
|
useSubscribeToResource: any;
|
|
61
60
|
useLinkQuery: any;
|
|
62
61
|
};
|
|
63
|
-
//# sourceMappingURL=createLdoSvelteMethods.d.ts.map
|
|
64
62
|
//#endregion
|
|
65
|
-
export { createLdoSvelteMethods
|
|
66
|
-
//# sourceMappingURL=createLdoSvelteMethods.d.
|
|
63
|
+
export { createLdoSvelteMethods };
|
|
64
|
+
//# sourceMappingURL=createLdoSvelteMethods.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLdoSvelteMethods.d.mts","names":[],"sources":["../src/createLdoSvelteMethods.tsx"],"mappings":";;;;;;;AA4DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,sBAAA,iBACE,eAAA,uBAAA,CAChB,OAAA,EAAS,OAAA"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { createUseLdo } from "./methods/useLdo.
|
|
2
|
-
import { createUseMatchObject } from "./methods/useMatchObject.
|
|
3
|
-
import { createUseMatchSubject } from "./methods/useMatchSubject.
|
|
4
|
-
import { createUseResource } from "./methods/useResource.
|
|
5
|
-
import { createUseSubject } from "./methods/useSubject.
|
|
6
|
-
import { createUseSubscribeToResource } from "./methods/useSubscribeToResource.
|
|
7
|
-
import { createUseLinkQuery } from "./methods/useLinkQuery.
|
|
1
|
+
import { createUseLdo } from "./methods/useLdo.mjs";
|
|
2
|
+
import { createUseMatchObject } from "./methods/useMatchObject.mjs";
|
|
3
|
+
import { createUseMatchSubject } from "./methods/useMatchSubject.mjs";
|
|
4
|
+
import { createUseResource } from "./methods/useResource.mjs";
|
|
5
|
+
import { createUseSubject } from "./methods/useSubject.mjs";
|
|
6
|
+
import { createUseSubscribeToResource } from "./methods/useSubscribeToResource.mjs";
|
|
7
|
+
import { createUseLinkQuery } from "./methods/useLinkQuery.mjs";
|
|
8
8
|
import { createConnectedLdoDataset } from "@ldo/connected";
|
|
9
|
-
|
|
10
9
|
//#region src/createLdoSvelteMethods.tsx
|
|
11
10
|
/**
|
|
12
11
|
* A function that creates all common react functions given specific plugin.
|
|
@@ -69,7 +68,7 @@ function createLdoSvelteMethods(plugins) {
|
|
|
69
68
|
useLinkQuery: createUseLinkQuery(dataset)
|
|
70
69
|
};
|
|
71
70
|
}
|
|
72
|
-
|
|
73
71
|
//#endregion
|
|
74
72
|
export { createLdoSvelteMethods };
|
|
75
|
-
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=createLdoSvelteMethods.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createLdoSvelteMethods.mjs","names":[],"sources":["../src/createLdoSvelteMethods.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createUseLdo } from \"./methods/useLdo\";\nimport {\n createConnectedLdoDataset,\n type ConnectedPlugin,\n} from \"@ldo/connected\";\nimport { createUseMatchObject } from \"./methods/useMatchObject\";\nimport { createUseMatchSubject } from \"./methods/useMatchSubject\";\nimport { createUseResource } from \"./methods/useResource\";\nimport { createUseSubject } from \"./methods/useSubject\";\nimport { createUseSubscribeToResource } from \"./methods/useSubscribeToResource\";\nimport { createUseLinkQuery } from \"./methods/useLinkQuery\";\n\n/**\n * A function that creates all common react functions given specific plugin.\n *\n * @example\n * `methods.ts`\n * ```tyepscript\n * import { solidConnectedPlugin } from \"@ldo/connected-solid\";\n * import { nextGraphConnectedPlugin } from \"@ldo/connected-nextgraph\";\n * import { createLdoReactMethods } from \"@ldo/react\";\n *\n * // Export the results to be used in the reset of the application\n * export const {\n * dataset,\n * useLdo,\n * useMatchObject,\n * useMatchSubject,\n * useResource,\n * useSubject,\n * useSubscribeToResource,\n * useLinkQuery,\n * } = createLdoReactMethods([\n * solidConnectedPlugin,\n * nextGraphConnectedPlugin\n * ]);\n * ```\n *\n * `App.tsx`\n * ```typescript\n * import react, { FunctionComponent } from \"react\";\n * import { PostShShapeType } from \"./_ldo/posts.shapeType.ts\";\n * import { useResource, useSubject } from \"./methods.ts\";\n *\n * const UseSubjectTest: FunctionComponent = () => {\n * const resource = useResource(SAMPLE_DATA_URI);\n * const post = useSubject(PostShShapeType, `${SAMPLE_DATA_URI}#Post1`);\n * if (resource.isLoading() || !post) return <p>loading</p>;\n *\n * return (\n * <ul>\n * {post.publisher.map((publisher) => {\n * return <li key={publisher[\"@id\"]}>{publisher[\"@id\"]}</li>;\n * })}\n * </ul>\n * );\n * };\n * ```\n */\nexport function createLdoSvelteMethods<\n Plugins extends ConnectedPlugin<any, any, any, any>[],\n>(plugins: Plugins) {\n const dataset = createConnectedLdoDataset(plugins);\n dataset.setMaxListeners(1000);\n\n return {\n dataset,\n useLdo: createUseLdo<Plugins>(dataset),\n useMatchObject: createUseMatchObject<Plugins>(dataset),\n useMatchSubject: createUseMatchSubject<Plugins>(dataset),\n useResource: createUseResource<Plugins>(dataset),\n useSubject: createUseSubject<Plugins>(dataset),\n useSubscribeToResource: createUseSubscribeToResource<Plugins>(dataset),\n useLinkQuery: createUseLinkQuery<Plugins>(dataset),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,uBAEd,SAAkB;CAClB,MAAM,UAAU,0BAA0B,QAAQ;AAClD,SAAQ,gBAAgB,IAAK;AAE7B,QAAO;EACL;EACA,QAAQ,aAAsB,QAAQ;EACtC,gBAAgB,qBAA8B,QAAQ;EACtD,iBAAiB,sBAA+B,QAAQ;EACxD,aAAa,kBAA2B,QAAQ;EAChD,YAAY,iBAA0B,QAAQ;EAC9C,wBAAwB,6BAAsC,QAAQ;EACtE,cAAc,mBAA4B,QAAQ;EACnD"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
exports.createLdoSvelteMethods =
|
|
11
|
-
exports.createUseLdo =
|
|
12
|
-
exports.createUseLinkQuery =
|
|
13
|
-
exports.createUseMatchObject =
|
|
14
|
-
exports.createUseMatchSubject =
|
|
15
|
-
exports.createUseResource =
|
|
16
|
-
exports.createUseSubject =
|
|
17
|
-
exports.createUseSubscribeToResource =
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_useLdo = require("./methods/useLdo.cjs");
|
|
3
|
+
const require_useMatchObject = require("./methods/useMatchObject.cjs");
|
|
4
|
+
const require_useMatchSubject = require("./methods/useMatchSubject.cjs");
|
|
5
|
+
const require_useResource = require("./methods/useResource.cjs");
|
|
6
|
+
const require_useSubject = require("./methods/useSubject.cjs");
|
|
7
|
+
const require_useSubscribeToResource = require("./methods/useSubscribeToResource.cjs");
|
|
8
|
+
const require_useLinkQuery = require("./methods/useLinkQuery.cjs");
|
|
9
|
+
const require_createLdoSvelteMethods = require("./createLdoSvelteMethods.cjs");
|
|
10
|
+
exports.createLdoSvelteMethods = require_createLdoSvelteMethods.createLdoSvelteMethods;
|
|
11
|
+
exports.createUseLdo = require_useLdo.createUseLdo;
|
|
12
|
+
exports.createUseLinkQuery = require_useLinkQuery.createUseLinkQuery;
|
|
13
|
+
exports.createUseMatchObject = require_useMatchObject.createUseMatchObject;
|
|
14
|
+
exports.createUseMatchSubject = require_useMatchSubject.createUseMatchSubject;
|
|
15
|
+
exports.createUseResource = require_useResource.createUseResource;
|
|
16
|
+
exports.createUseSubject = require_useSubject.createUseSubject;
|
|
17
|
+
exports.createUseSubscribeToResource = require_useSubscribeToResource.createUseSubscribeToResource;
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createLdoSvelteMethods } from "./createLdoSvelteMethods.mjs";
|
|
2
|
+
import { UseLdoMethods, createUseLdo } from "./methods/useLdo.mjs";
|
|
3
|
+
import { createUseMatchObject } from "./methods/useMatchObject.mjs";
|
|
4
|
+
import { createUseMatchSubject } from "./methods/useMatchSubject.mjs";
|
|
5
|
+
import { UseResourceOptions, createUseResource, useResourceType } from "./methods/useResource.mjs";
|
|
6
|
+
import { createUseSubject, useSubjectType } from "./methods/useSubject.mjs";
|
|
7
|
+
import { createUseSubscribeToResource } from "./methods/useSubscribeToResource.mjs";
|
|
8
|
+
import { createUseLinkQuery } from "./methods/useLinkQuery.mjs";
|
|
9
|
+
export { UseLdoMethods, UseResourceOptions, createLdoSvelteMethods, createUseLdo, createUseLinkQuery, createUseMatchObject, createUseMatchSubject, createUseResource, createUseSubject, createUseSubscribeToResource, useResourceType, useSubjectType };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createUseLdo } from "./methods/useLdo.mjs";
|
|
2
|
+
import { createUseMatchObject } from "./methods/useMatchObject.mjs";
|
|
3
|
+
import { createUseMatchSubject } from "./methods/useMatchSubject.mjs";
|
|
4
|
+
import { createUseResource } from "./methods/useResource.mjs";
|
|
5
|
+
import { createUseSubject } from "./methods/useSubject.mjs";
|
|
6
|
+
import { createUseSubscribeToResource } from "./methods/useSubscribeToResource.mjs";
|
|
7
|
+
import { createUseLinkQuery } from "./methods/useLinkQuery.mjs";
|
|
8
|
+
import { createLdoSvelteMethods } from "./createLdoSvelteMethods.mjs";
|
|
9
|
+
export { createLdoSvelteMethods, createUseLdo, createUseLinkQuery, createUseMatchObject, createUseMatchSubject, createUseResource, createUseSubject, createUseSubscribeToResource };
|
package/dist/methods/useLdo.cjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const __ldo_ldo = require_rolldown_runtime.__toESM(require("@ldo/ldo"));
|
|
4
|
-
|
|
1
|
+
let _ldo_connected = require("@ldo/connected");
|
|
2
|
+
let _ldo_ldo = require("@ldo/ldo");
|
|
5
3
|
//#region src/methods/useLdo.ts
|
|
6
4
|
/**
|
|
7
5
|
* @internal
|
|
@@ -18,16 +16,14 @@ function createUseLdo(dataset) {
|
|
|
18
16
|
createData(shapeType, subject, resource, ...additionalResources) {
|
|
19
17
|
return dataset.createData(shapeType, subject, resource, ...additionalResources);
|
|
20
18
|
},
|
|
21
|
-
changeData:
|
|
19
|
+
changeData: _ldo_connected.changeData,
|
|
22
20
|
commitData(input) {
|
|
23
|
-
|
|
24
|
-
return inputDataset.commitToRemote();
|
|
21
|
+
return (0, _ldo_ldo.getDataset)(input).commitToRemote();
|
|
25
22
|
}
|
|
26
23
|
};
|
|
27
24
|
return function useLdo() {
|
|
28
25
|
return toReturn;
|
|
29
26
|
};
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
//#endregion
|
|
33
|
-
exports.createUseLdo = createUseLdo;
|
|
29
|
+
exports.createUseLdo = createUseLdo;
|
|
@@ -3,7 +3,6 @@ import { LdoBase, ShapeType } from "@ldo/ldo";
|
|
|
3
3
|
import { SubjectNode } from "@ldo/rdf-utils";
|
|
4
4
|
|
|
5
5
|
//#region src/methods/useLdo.d.ts
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* The methods returned by useLdo
|
|
9
8
|
*/
|
|
@@ -59,7 +58,6 @@ interface UseLdoMethods<Plugins extends ConnectedPlugin[]> {
|
|
|
59
58
|
* Creates the useLdoHook
|
|
60
59
|
*/
|
|
61
60
|
declare function createUseLdo<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): () => UseLdoMethods<Plugins>;
|
|
62
|
-
//# sourceMappingURL=useLdo.d.ts.map
|
|
63
61
|
//#endregion
|
|
64
62
|
export { UseLdoMethods, createUseLdo };
|
|
65
63
|
//# sourceMappingURL=useLdo.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLdo.d.cts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"useLdo.d.cts","names":[],"sources":["../../src/methods/useLdo.ts"],"mappings":";;;;;;;AAaA;UAAiB,aAAA,iBAA8B,eAAA;EAAjB;;;EAI5B,OAAA,EAAS,mBAAA,CAAoB,OAAA;EAYI;;;;;;;;;;;EAAjC,WAAA,EAAa,mBAAA,CAAoB,OAAA;EA0Bb;;;;;;EAnBpB,UAAA,EAAY,mBAAA,CAAoB,OAAA;EA6BN;;;EAzB1B,UAAA,cAAwB,OAAA,EACtB,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,OAAA,WAAkB,WAAA,GACjB,IAAA;EA6BW;;;;;;;;;EAnBd,UAAA,cAAwB,OAAA,EACtB,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,OAAA,WAAkB,WAAA,EAClB,QAAA,EAAU,OAAA,kCACP,mBAAA,EAAqB,OAAA,kCACvB,IAAA;EA7BU;;;EAiCb,UAAA,cAAwB,OAAA,EACtB,KAAA,EAAO,IAAA,EACP,QAAA,EAAU,OAAA,kCACP,mBAAA,EAAqB,OAAA,kCACvB,IAAA;EA9B6B;;;EAkChC,UAAA,CACE,KAAA,EAAO,OAAA,GACN,UAAA,CAAW,8BAAA,CAA+B,OAAA;AAAA;;;;;iBAO/B,YAAA,iBAA6B,eAAA,GAAA,CAC3C,OAAA,EAAS,mBAAA,CAAoB,OAAA,UA+DH,aAAA,CAAc,OAAA"}
|
|
@@ -3,7 +3,6 @@ import { LdoBase, ShapeType } from "@ldo/ldo";
|
|
|
3
3
|
import { SubjectNode } from "@ldo/rdf-utils";
|
|
4
4
|
|
|
5
5
|
//#region src/methods/useLdo.d.ts
|
|
6
|
-
|
|
7
6
|
/**
|
|
8
7
|
* The methods returned by useLdo
|
|
9
8
|
*/
|
|
@@ -59,7 +58,6 @@ interface UseLdoMethods<Plugins extends ConnectedPlugin[]> {
|
|
|
59
58
|
* Creates the useLdoHook
|
|
60
59
|
*/
|
|
61
60
|
declare function createUseLdo<Plugins extends ConnectedPlugin[]>(dataset: ConnectedLdoDataset<Plugins>): () => UseLdoMethods<Plugins>;
|
|
62
|
-
//# sourceMappingURL=useLdo.d.ts.map
|
|
63
61
|
//#endregion
|
|
64
|
-
export { UseLdoMethods, createUseLdo
|
|
65
|
-
//# sourceMappingURL=useLdo.d.
|
|
62
|
+
export { UseLdoMethods, createUseLdo };
|
|
63
|
+
//# sourceMappingURL=useLdo.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLdo.d.mts","names":[],"sources":["../../src/methods/useLdo.ts"],"mappings":";;;;;;;AAaA;UAAiB,aAAA,iBAA8B,eAAA;EAAjB;;;EAI5B,OAAA,EAAS,mBAAA,CAAoB,OAAA;EAYI;;;;;;;;;;;EAAjC,WAAA,EAAa,mBAAA,CAAoB,OAAA;EA0Bb;;;;;;EAnBpB,UAAA,EAAY,mBAAA,CAAoB,OAAA;EA6BN;;;EAzB1B,UAAA,cAAwB,OAAA,EACtB,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,OAAA,WAAkB,WAAA,GACjB,IAAA;EA6BW;;;;;;;;;EAnBd,UAAA,cAAwB,OAAA,EACtB,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,OAAA,WAAkB,WAAA,EAClB,QAAA,EAAU,OAAA,kCACP,mBAAA,EAAqB,OAAA,kCACvB,IAAA;EA7BU;;;EAiCb,UAAA,cAAwB,OAAA,EACtB,KAAA,EAAO,IAAA,EACP,QAAA,EAAU,OAAA,kCACP,mBAAA,EAAqB,OAAA,kCACvB,IAAA;EA9B6B;;;EAkChC,UAAA,CACE,KAAA,EAAO,OAAA,GACN,UAAA,CAAW,8BAAA,CAA+B,OAAA;AAAA;;;;;iBAO/B,YAAA,iBAA6B,eAAA,GAAA,CAC3C,OAAA,EAAS,mBAAA,CAAoB,OAAA,UA+DH,aAAA,CAAc,OAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { changeData } from "@ldo/connected";
|
|
2
2
|
import { getDataset } from "@ldo/ldo";
|
|
3
|
-
|
|
4
3
|
//#region src/methods/useLdo.ts
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
@@ -19,15 +18,14 @@ function createUseLdo(dataset) {
|
|
|
19
18
|
},
|
|
20
19
|
changeData,
|
|
21
20
|
commitData(input) {
|
|
22
|
-
|
|
23
|
-
return inputDataset.commitToRemote();
|
|
21
|
+
return getDataset(input).commitToRemote();
|
|
24
22
|
}
|
|
25
23
|
};
|
|
26
24
|
return function useLdo() {
|
|
27
25
|
return toReturn;
|
|
28
26
|
};
|
|
29
27
|
}
|
|
30
|
-
|
|
31
28
|
//#endregion
|
|
32
29
|
export { createUseLdo };
|
|
33
|
-
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=useLdo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLdo.mjs","names":[],"sources":["../../src/methods/useLdo.ts"],"sourcesContent":["import {\n changeData,\n // changeData,\n type ConnectedLdoDataset,\n type ConnectedLdoTransactionDataset,\n type ConnectedPlugin,\n} from \"@ldo/connected\";\nimport { getDataset, type LdoBase, type ShapeType } from \"@ldo/ldo\";\nimport type { SubjectNode } from \"@ldo/rdf-utils\";\n\n/**\n * The methods returned by useLdo\n */\nexport interface UseLdoMethods<Plugins extends ConnectedPlugin[]> {\n /**\n * A ConnectedLdoDataset\n */\n dataset: ConnectedLdoDataset<Plugins>;\n /**\n * Retireves a representation of a Resource at the given URI. This resource\n * represents the current state of the resource: whether it is currently\n * fetched or in the process of fetching as well as some information about it.\n *\n * @param uri - the URI of the resource\n * @param pluginName - optionally, force this function to choose a specific\n * plugin to use rather than perform content negotiation.\n *\n * @returns a Resource\n */\n getResource: ConnectedLdoDataset<Plugins>[\"getResource\"];\n /**\n * Sets conetext for a specific plugin\n *\n * @param pluginName - the name of the plugin\n * @param context - the context for this specific plugin\n */\n setContext: ConnectedLdoDataset<Plugins>[\"setContext\"];\n /**\n * Gets a linked data object based on the subject\n */\n getSubject<Type extends LdoBase>(\n shapeType: ShapeType<Type>,\n subject: string | SubjectNode,\n ): Type;\n /**\n * Shorthand for connectedLdoDataset\n * .usingType(shapeType)\n * .write(...resources.map((r) => r.uri))\n * .fromSubject(subject);\n * @param shapeType - The shapetype to represent the data\n * @param subject - A subject URI\n * @param resources - The resources changes to should written to\n */\n createData<Type extends LdoBase>(\n shapeType: ShapeType<Type>,\n subject: string | SubjectNode,\n resource: Plugins[number][\"types\"][\"resource\"],\n ...additionalResources: Plugins[number][\"types\"][\"resource\"][]\n ): Type;\n /**\n * Returns a writable LinkedDataObject given a linked data object\n */\n changeData<Type extends LdoBase>(\n input: Type,\n resource: Plugins[number][\"types\"][\"resource\"],\n ...additionalResources: Plugins[number][\"types\"][\"resource\"][]\n ): Type;\n /**\n * Commits the data of a writable Linke Data Object back to the remote.\n */\n commitData(\n input: LdoBase,\n ): ReturnType<ConnectedLdoTransactionDataset<Plugins>[\"commitToRemote\"]>;\n}\n\n/**\n * @internal\n * Creates the useLdoHook\n */\nexport function createUseLdo<Plugins extends ConnectedPlugin[]>(\n dataset: ConnectedLdoDataset<Plugins>,\n) {\n const toReturn = {\n dataset,\n /**\n * Gets a resource\n */\n getResource: dataset.getResource.bind(dataset),\n /**\n * Set the context\n */\n setContext: dataset.setContext.bind(dataset),\n /**\n * Returns a Linked Data Object for a subject\n * @param shapeType The shape type for the data\n * @param subject Subject Node\n * @returns A Linked Data Object\n */\n getSubject<Type extends LdoBase>(\n shapeType: ShapeType<Type>,\n subject: string | SubjectNode,\n ): Type {\n return dataset.usingType(shapeType).fromSubject(subject);\n },\n /**\n * Begins tracking changes to eventually commit for a new subject\n * @param shapeType The shape type that defines the created data\n * @param subject The RDF subject for a Linked Data Object\n * @param resources Any number of resources to which this data should be written\n * @returns A Linked Data Object to modify and commit\n */\n createData<Type extends LdoBase>(\n shapeType: ShapeType<Type>,\n subject: string | SubjectNode,\n resource: Plugins[number][\"types\"][\"resource\"],\n ...additionalResources: Plugins[number][\"types\"][\"resource\"][]\n ): Type {\n return dataset.createData(\n shapeType,\n subject,\n resource,\n ...additionalResources,\n );\n },\n /**\n * Begins tracking changes to eventually commit\n * @param input A linked data object to track changes on\n * @param resources\n */\n changeData: changeData,\n /**\n * Commits the transaction to the global dataset, syncing all subscribing\n * components and Solid Pods\n */\n commitData(\n input: LdoBase,\n ): ReturnType<ConnectedLdoTransactionDataset<Plugins>[\"commitToRemote\"]> {\n const inputDataset = getDataset(\n input,\n ) as ConnectedLdoTransactionDataset<Plugins>;\n return inputDataset.commitToRemote();\n },\n };\n return function useLdo(): UseLdoMethods<Plugins> {\n return toReturn;\n };\n}\n"],"mappings":";;;;;;;AA+EA,SAAgB,aACd,SACA;CACA,MAAM,WAAW;EACf;EAIA,aAAa,QAAQ,YAAY,KAAK,QAAQ;EAI9C,YAAY,QAAQ,WAAW,KAAK,QAAQ;EAO5C,WACE,WACA,SACM;AACN,UAAO,QAAQ,UAAU,UAAU,CAAC,YAAY,QAAQ;;EAS1D,WACE,WACA,SACA,UACA,GAAG,qBACG;AACN,UAAO,QAAQ,WACb,WACA,SACA,UACA,GAAG,oBACJ;;EAOS;EAKZ,WACE,OACuE;AAIvE,UAHqB,WACnB,MACD,CACmB,gBAAgB;;EAEvC;AACD,QAAO,SAAS,SAAiC;AAC/C,SAAO"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
const svelte = require_rolldown_runtime.__toESM(require("svelte"));
|
|
4
|
-
|
|
1
|
+
const require_useTrackingProxy = require("../util/useTrackingProxy.cjs");
|
|
2
|
+
let svelte = require("svelte");
|
|
5
3
|
//#region src/methods/useLinkQuery.ts
|
|
6
4
|
/**
|
|
7
5
|
* @internal
|
|
@@ -27,9 +25,8 @@ function createUseLinkQuery(dataset) {
|
|
|
27
25
|
if (!startingSubject) return;
|
|
28
26
|
return builder.fromSubject(startingSubject);
|
|
29
27
|
};
|
|
30
|
-
return
|
|
28
|
+
return require_useTrackingProxy.useTrackingProxy(shapeType, fromSubject, dataset);
|
|
31
29
|
};
|
|
32
30
|
}
|
|
33
|
-
|
|
34
31
|
//#endregion
|
|
35
|
-
exports.createUseLinkQuery = createUseLinkQuery;
|
|
32
|
+
exports.createUseLinkQuery = createUseLinkQuery;
|
|
@@ -4,15 +4,12 @@ import { SubjectNode } from "@ldo/rdf-utils";
|
|
|
4
4
|
import { Readable } from "svelte/store";
|
|
5
5
|
|
|
6
6
|
//#region src/methods/useLinkQuery.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @internal
|
|
10
9
|
*
|
|
11
10
|
* Creates a useMatchSubject function.
|
|
12
11
|
*/
|
|
13
12
|
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>;
|
|
14
|
-
//# sourceMappingURL=useLinkQuery.d.ts.map
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
14
|
export { createUseLinkQuery };
|
|
18
15
|
//# sourceMappingURL=useLinkQuery.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkQuery.d.cts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"useLinkQuery.d.cts","names":[],"sources":["../../src/methods/useLinkQuery.ts"],"mappings":";;;;;;;;AAkBA;;;iBAAgB,kBAAA,iBAAmC,eAAA,GAAA,CACjD,OAAA,EAAS,mBAAA,CAAoB,OAAA,kBAOd,OAAA,qBACM,OAAA,CAAQ,IAAA,GAE3B,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,gBAAA,UACA,eAAA,EAAiB,WAAA,WACjB,SAAA,EAAW,UAAA,KACV,QAAA,CAAS,UAAA,CAAW,QAAA,CAAS,IAAA,EAAM,UAAA"}
|
|
@@ -4,15 +4,12 @@ import { Readable } from "svelte/store";
|
|
|
4
4
|
import { SubjectNode } from "@ldo/rdf-utils";
|
|
5
5
|
|
|
6
6
|
//#region src/methods/useLinkQuery.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @internal
|
|
10
9
|
*
|
|
11
10
|
* Creates a useMatchSubject function.
|
|
12
11
|
*/
|
|
13
12
|
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>;
|
|
14
|
-
//# sourceMappingURL=useLinkQuery.d.ts.map
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
|
-
export { createUseLinkQuery
|
|
18
|
-
//# sourceMappingURL=useLinkQuery.d.
|
|
14
|
+
export { createUseLinkQuery };
|
|
15
|
+
//# sourceMappingURL=useLinkQuery.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkQuery.d.mts","names":[],"sources":["../../src/methods/useLinkQuery.ts"],"mappings":";;;;;;;;AAkBA;;;iBAAgB,kBAAA,iBAAmC,eAAA,GAAA,CACjD,OAAA,EAAS,mBAAA,CAAoB,OAAA,kBAOd,OAAA,qBACM,OAAA,CAAQ,IAAA,GAE3B,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,gBAAA,UACA,eAAA,EAAiB,WAAA,WACjB,SAAA,EAAW,UAAA,KACV,QAAA,CAAS,UAAA,CAAW,QAAA,CAAS,IAAA,EAAM,UAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { useTrackingProxy } from "../util/useTrackingProxy.
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.mjs";
|
|
2
2
|
import { onDestroy } from "svelte";
|
|
3
|
-
|
|
4
3
|
//#region src/methods/useLinkQuery.ts
|
|
5
4
|
/**
|
|
6
5
|
* @internal
|
|
@@ -29,7 +28,7 @@ function createUseLinkQuery(dataset) {
|
|
|
29
28
|
return useTrackingProxy(shapeType, fromSubject, dataset);
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
//#endregion
|
|
34
32
|
export { createUseLinkQuery };
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=useLinkQuery.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkQuery.mjs","names":[],"sources":["../../src/methods/useLinkQuery.ts"],"sourcesContent":["import {\n type ConnectedLdoDataset,\n type ConnectedPlugin,\n type ExpandDeep,\n type LQInput,\n type LQReturn,\n} from \"@ldo/connected\";\nimport { type LdoBase, type LdoBuilder, type ShapeType } from \"@ldo/ldo\";\nimport type { SubjectNode } from \"@ldo/rdf-utils\";\nimport { type Readable } from \"svelte/store\";\nimport { useTrackingProxy } from \"../util/useTrackingProxy\";\nimport { onDestroy } from \"svelte\";\n\n/**\n * @internal\n *\n * Creates a useMatchSubject function.\n */\nexport function createUseLinkQuery<Plugins extends ConnectedPlugin[]>(\n dataset: ConnectedLdoDataset<Plugins>,\n) {\n /**\n * Returns an array of matching linked data objects. Triggers a rerender if\n * the data is updated.\n */\n return function useQueryLink<\n Type extends LdoBase,\n QueryInput extends LQInput<Type>,\n >(\n shapeType: ShapeType<Type>,\n startingResource: string,\n startingSubject: SubjectNode | string,\n linkQuery: QueryInput,\n ): Readable<ExpandDeep<LQReturn<Type, QueryInput>> | undefined> {\n const resource = dataset.getResource(startingResource);\n console.log(resource);\n const lq = dataset\n .usingType(shapeType)\n .startLinkQuery(resource, startingSubject, linkQuery);\n console.log(\"Calling subscribe\");\n lq.subscribe();\n console.log(\"After call subscribe\");\n\n onDestroy(() => {\n lq.unsubscribeAll();\n });\n\n const fromSubject = (builder: LdoBuilder<Type>) => {\n if (!startingSubject) return;\n return builder.fromSubject(startingSubject);\n };\n\n return useTrackingProxy(\n shapeType,\n fromSubject,\n dataset,\n ) as unknown as Readable<ExpandDeep<LQReturn<Type, QueryInput>>>;\n };\n}\n"],"mappings":";;;;;;;;AAkBA,SAAgB,mBACd,SACA;;;;;AAKA,QAAO,SAAS,aAId,WACA,kBACA,iBACA,WAC8D;EAC9D,MAAM,WAAW,QAAQ,YAAY,iBAAiB;AACtD,UAAQ,IAAI,SAAS;EACrB,MAAM,KAAK,QACR,UAAU,UAAU,CACpB,eAAe,UAAU,iBAAiB,UAAU;AACvD,UAAQ,IAAI,oBAAoB;AAChC,KAAG,WAAW;AACd,UAAQ,IAAI,uBAAuB;AAEnC,kBAAgB;AACd,MAAG,gBAAgB;IACnB;EAEF,MAAM,eAAe,YAA8B;AACjD,OAAI,CAAC,gBAAiB;AACtB,UAAO,QAAQ,YAAY,gBAAgB;;AAG7C,SAAO,iBACL,WACA,aACA,QACD"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const require_useTrackingProxy = require("../util/useTrackingProxy.cjs");
|
|
3
2
|
//#region src/methods/useMatchObject.ts
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
@@ -15,9 +14,8 @@ function createUseMatchObject(dataset) {
|
|
|
15
14
|
const matchObject = (builder) => {
|
|
16
15
|
return builder.matchObject(subject, predicate, graph);
|
|
17
16
|
};
|
|
18
|
-
return
|
|
17
|
+
return require_useTrackingProxy.useTrackingProxy(shapeType, matchObject, dataset);
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
|
-
exports.createUseMatchObject = createUseMatchObject;
|
|
21
|
+
exports.createUseMatchObject = createUseMatchObject;
|
|
@@ -4,15 +4,12 @@ import { QuadMatch } from "@ldo/rdf-utils";
|
|
|
4
4
|
import { Readable } from "svelte/store";
|
|
5
5
|
|
|
6
6
|
//#region src/methods/useMatchObject.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @internal
|
|
10
9
|
*
|
|
11
10
|
* Creates a useMatchObject function
|
|
12
11
|
*/
|
|
13
12
|
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>>;
|
|
14
|
-
//# sourceMappingURL=useMatchObject.d.ts.map
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
14
|
export { createUseMatchObject };
|
|
18
15
|
//# sourceMappingURL=useMatchObject.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatchObject.d.cts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"useMatchObject.d.cts","names":[],"sources":["../../src/methods/useMatchObject.ts"],"mappings":";;;;;;;;AAWA;;;iBAAgB,oBAAA,iBAAqC,eAAA,GAAA,CACnD,OAAA,EAAS,mBAAA,CAAoB,OAAA,kBAMe,OAAA,EAC1C,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,OAAA,GAAU,SAAA,cACV,SAAA,GAAY,SAAA,cACZ,KAAA,GAAQ,SAAA,iBACP,QAAA,CAAS,KAAA,CAAM,IAAA"}
|
|
@@ -4,15 +4,12 @@ import { Readable } from "svelte/store";
|
|
|
4
4
|
import { QuadMatch } from "@ldo/rdf-utils";
|
|
5
5
|
|
|
6
6
|
//#region src/methods/useMatchObject.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @internal
|
|
10
9
|
*
|
|
11
10
|
* Creates a useMatchObject function
|
|
12
11
|
*/
|
|
13
12
|
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>>;
|
|
14
|
-
//# sourceMappingURL=useMatchObject.d.ts.map
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
|
-
export { createUseMatchObject
|
|
18
|
-
//# sourceMappingURL=useMatchObject.d.
|
|
14
|
+
export { createUseMatchObject };
|
|
15
|
+
//# sourceMappingURL=useMatchObject.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchObject.d.mts","names":[],"sources":["../../src/methods/useMatchObject.ts"],"mappings":";;;;;;;;AAWA;;;iBAAgB,oBAAA,iBAAqC,eAAA,GAAA,CACnD,OAAA,EAAS,mBAAA,CAAoB,OAAA,kBAMe,OAAA,EAC1C,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,OAAA,GAAU,SAAA,cACV,SAAA,GAAY,SAAA,cACZ,KAAA,GAAQ,SAAA,iBACP,QAAA,CAAS,KAAA,CAAM,IAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { useTrackingProxy } from "../util/useTrackingProxy.
|
|
2
|
-
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.mjs";
|
|
3
2
|
//#region src/methods/useMatchObject.ts
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
@@ -18,7 +17,7 @@ function createUseMatchObject(dataset) {
|
|
|
18
17
|
return useTrackingProxy(shapeType, matchObject, dataset);
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
21
|
export { createUseMatchObject };
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=useMatchObject.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchObject.mjs","names":[],"sources":["../../src/methods/useMatchObject.ts"],"sourcesContent":["import type { LdoBase, LdoBuilder, LdSet, ShapeType } from \"@ldo/ldo\";\nimport type { QuadMatch } from \"@ldo/rdf-utils\";\nimport type { ConnectedLdoDataset, ConnectedPlugin } from \"@ldo/connected\";\nimport type { Readable } from \"svelte/store\";\nimport { useTrackingProxy } from \"../util/useTrackingProxy\";\n\n/**\n * @internal\n *\n * Creates a useMatchObject function\n */\nexport function createUseMatchObject<Plugins extends ConnectedPlugin[]>(\n dataset: ConnectedLdoDataset<Plugins>,\n) {\n /**\n * Returns an array of matching items and triggers a rerender when that data\n * is updated.\n */\n return function useMatchObject<Type extends LdoBase>(\n shapeType: ShapeType<Type>,\n subject?: QuadMatch[0] | string,\n predicate?: QuadMatch[1] | string,\n graph?: QuadMatch[3] | string,\n ): Readable<LdSet<Type>> {\n const matchObject = (builder: LdoBuilder<Type>) => {\n return builder.matchObject(subject, predicate, graph);\n };\n\n return useTrackingProxy(shapeType, matchObject, dataset);\n };\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,qBACd,SACA;;;;;AAKA,QAAO,SAAS,eACd,WACA,SACA,WACA,OACuB;EACvB,MAAM,eAAe,YAA8B;AACjD,UAAO,QAAQ,YAAY,SAAS,WAAW,MAAM;;AAGvD,SAAO,iBAAiB,WAAW,aAAa,QAAQ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const require_useTrackingProxy = require("../util/useTrackingProxy.cjs");
|
|
3
2
|
//#region src/methods/useMatchSubject.ts
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
@@ -15,9 +14,8 @@ function createUseMatchSubject(dataset) {
|
|
|
15
14
|
const matchSubject = (builder) => {
|
|
16
15
|
return builder.matchSubject(predicate, object, graph);
|
|
17
16
|
};
|
|
18
|
-
return
|
|
17
|
+
return require_useTrackingProxy.useTrackingProxy(shapeType, matchSubject, dataset);
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
|
-
exports.createUseMatchSubject = createUseMatchSubject;
|
|
21
|
+
exports.createUseMatchSubject = createUseMatchSubject;
|
|
@@ -4,15 +4,12 @@ import { QuadMatch } from "@ldo/rdf-utils";
|
|
|
4
4
|
import { Readable } from "svelte/store";
|
|
5
5
|
|
|
6
6
|
//#region src/methods/useMatchSubject.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @internal
|
|
10
9
|
*
|
|
11
10
|
* Creates a useMatchSubject function.
|
|
12
11
|
*/
|
|
13
12
|
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>>;
|
|
14
|
-
//# sourceMappingURL=useMatchSubject.d.ts.map
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
14
|
export { createUseMatchSubject };
|
|
18
15
|
//# sourceMappingURL=useMatchSubject.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMatchSubject.d.cts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"useMatchSubject.d.cts","names":[],"sources":["../../src/methods/useMatchSubject.ts"],"mappings":";;;;;;;;AAWA;;;iBAAgB,qBAAA,iBAAsC,eAAA,GAAA,CACpD,OAAA,EAAS,mBAAA,CAAoB,OAAA,kBAMgB,OAAA,EAC3C,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,SAAA,GAAY,SAAA,cACZ,MAAA,GAAS,SAAA,cACT,KAAA,GAAQ,SAAA,iBACP,QAAA,CAAS,KAAA,CAAM,IAAA"}
|
|
@@ -4,15 +4,12 @@ import { Readable } from "svelte/store";
|
|
|
4
4
|
import { QuadMatch } from "@ldo/rdf-utils";
|
|
5
5
|
|
|
6
6
|
//#region src/methods/useMatchSubject.d.ts
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* @internal
|
|
10
9
|
*
|
|
11
10
|
* Creates a useMatchSubject function.
|
|
12
11
|
*/
|
|
13
12
|
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>>;
|
|
14
|
-
//# sourceMappingURL=useMatchSubject.d.ts.map
|
|
15
|
-
|
|
16
13
|
//#endregion
|
|
17
|
-
export { createUseMatchSubject
|
|
18
|
-
//# sourceMappingURL=useMatchSubject.d.
|
|
14
|
+
export { createUseMatchSubject };
|
|
15
|
+
//# sourceMappingURL=useMatchSubject.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchSubject.d.mts","names":[],"sources":["../../src/methods/useMatchSubject.ts"],"mappings":";;;;;;;;AAWA;;;iBAAgB,qBAAA,iBAAsC,eAAA,GAAA,CACpD,OAAA,EAAS,mBAAA,CAAoB,OAAA,kBAMgB,OAAA,EAC3C,SAAA,EAAW,SAAA,CAAU,IAAA,GACrB,SAAA,GAAY,SAAA,cACZ,MAAA,GAAS,SAAA,cACT,KAAA,GAAQ,SAAA,iBACP,QAAA,CAAS,KAAA,CAAM,IAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { useTrackingProxy } from "../util/useTrackingProxy.
|
|
2
|
-
|
|
1
|
+
import { useTrackingProxy } from "../util/useTrackingProxy.mjs";
|
|
3
2
|
//#region src/methods/useMatchSubject.ts
|
|
4
3
|
/**
|
|
5
4
|
* @internal
|
|
@@ -18,7 +17,7 @@ function createUseMatchSubject(dataset) {
|
|
|
18
17
|
return useTrackingProxy(shapeType, matchSubject, dataset);
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
21
|
export { createUseMatchSubject };
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=useMatchSubject.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMatchSubject.mjs","names":[],"sources":["../../src/methods/useMatchSubject.ts"],"sourcesContent":["import type { LdoBase, LdoBuilder, LdSet, ShapeType } from \"@ldo/ldo\";\nimport type { QuadMatch } from \"@ldo/rdf-utils\";\nimport type { ConnectedLdoDataset, ConnectedPlugin } from \"@ldo/connected\";\nimport { useTrackingProxy } from \"../util/useTrackingProxy\";\nimport type { Readable } from \"svelte/store\";\n\n/**\n * @internal\n *\n * Creates a useMatchSubject function.\n */\nexport function createUseMatchSubject<Plugins extends ConnectedPlugin[]>(\n dataset: ConnectedLdoDataset<Plugins>,\n) {\n /**\n * Returns an array of matching linked data objects. Triggers a rerender if\n * the data is updated.\n */\n return function useMatchSubject<Type extends LdoBase>(\n shapeType: ShapeType<Type>,\n predicate?: QuadMatch[1] | string,\n object?: QuadMatch[2] | string,\n graph?: QuadMatch[3] | string,\n ): Readable<LdSet<Type>> {\n const matchSubject = (builder: LdoBuilder<Type>) => {\n return builder.matchSubject(predicate, object, graph);\n };\n\n return useTrackingProxy(shapeType, matchSubject, dataset);\n };\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,sBACd,SACA;;;;;AAKA,QAAO,SAAS,gBACd,WACA,WACA,QACA,OACuB;EACvB,MAAM,gBAAgB,YAA8B;AAClD,UAAO,QAAQ,aAAa,WAAW,QAAQ,MAAM;;AAGvD,SAAO,iBAAiB,WAAW,cAAc,QAAQ"}
|