@fragmentsx/client-core 0.0.1

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 (39) hide show
  1. package/dist/fragmentsClient.d.ts +7 -0
  2. package/dist/fragmentsClient.d.ts.map +1 -0
  3. package/dist/index.cjs.js +1862 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.es.js +1862 -0
  7. package/dist/plugins/fetch/beacon.d.ts +4 -0
  8. package/dist/plugins/fetch/beacon.d.ts.map +1 -0
  9. package/dist/plugins/fetch/emptyFragment.d.ts +50 -0
  10. package/dist/plugins/fetch/emptyFragment.d.ts.map +1 -0
  11. package/dist/plugins/fetch/fetcher.d.ts +6 -0
  12. package/dist/plugins/fetch/fetcher.d.ts.map +1 -0
  13. package/dist/plugins/fetch/index.d.ts +3 -0
  14. package/dist/plugins/fetch/index.d.ts.map +1 -0
  15. package/dist/plugins/fetch/queries/FragmentQuery.d.ts +2 -0
  16. package/dist/plugins/fetch/queries/FragmentQuery.d.ts.map +1 -0
  17. package/dist/plugins/fetch/queries/LandingQuery.d.ts +2 -0
  18. package/dist/plugins/fetch/queries/LandingQuery.d.ts.map +1 -0
  19. package/dist/plugins/fragments/index.d.ts +3 -0
  20. package/dist/plugins/fragments/index.d.ts.map +1 -0
  21. package/dist/plugins/metrics/index.d.ts +3 -0
  22. package/dist/plugins/metrics/index.d.ts.map +1 -0
  23. package/dist/plugins/metrics/queries/addClientMetric.d.ts +2 -0
  24. package/dist/plugins/metrics/queries/addClientMetric.d.ts.map +1 -0
  25. package/dist/plugins/styleSheet/buildCssBlock.d.ts +2 -0
  26. package/dist/plugins/styleSheet/buildCssBlock.d.ts.map +1 -0
  27. package/dist/plugins/styleSheet/compareRules.d.ts +4 -0
  28. package/dist/plugins/styleSheet/compareRules.d.ts.map +1 -0
  29. package/dist/plugins/styleSheet/findGroups.d.ts +8 -0
  30. package/dist/plugins/styleSheet/findGroups.d.ts.map +1 -0
  31. package/dist/plugins/styleSheet/getAllChildren.d.ts +3 -0
  32. package/dist/plugins/styleSheet/getAllChildren.d.ts.map +1 -0
  33. package/dist/plugins/styleSheet/index.d.ts +3 -0
  34. package/dist/plugins/styleSheet/index.d.ts.map +1 -0
  35. package/dist/plugins/styleSheet/makeCss.d.ts +6 -0
  36. package/dist/plugins/styleSheet/makeCss.d.ts.map +1 -0
  37. package/dist/plugins/styleSheet/toCSS.d.ts +2 -0
  38. package/dist/plugins/styleSheet/toCSS.d.ts.map +1 -0
  39. package/package.json +38 -0
@@ -0,0 +1,4 @@
1
+ export declare const fetchBeacon: (baseUrl: string) => {
2
+ sendBeacon: (data?: unknown) => void;
3
+ };
4
+ //# sourceMappingURL=beacon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"beacon.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/beacon.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,YAAa,MAAM;wBAMd,OAAO;CAWnC,CAAC"}
@@ -0,0 +1,50 @@
1
+ export declare const getEmptyFragment: (fragmentId: string) => {
2
+ [x: string]: {
3
+ _type: string;
4
+ _id: string;
5
+ children: string[];
6
+ layoutSizingHorizontal: string;
7
+ layoutSizingVertical: string;
8
+ horizontalGrow: string;
9
+ verticalGrow: string;
10
+ renderMode: string;
11
+ opacity: number;
12
+ visible: boolean;
13
+ overflow: string;
14
+ overrides: never[];
15
+ properties: string[];
16
+ parent?: undefined;
17
+ width?: undefined;
18
+ height?: undefined;
19
+ fillType?: undefined;
20
+ positionType?: undefined;
21
+ solidFill?: undefined;
22
+ name?: undefined;
23
+ isPrimary?: undefined;
24
+ threshold?: undefined;
25
+ } | {
26
+ _type: string;
27
+ _id: string;
28
+ opacity: number;
29
+ parent: string;
30
+ visible: boolean;
31
+ overflow: string;
32
+ children: never[];
33
+ width: number;
34
+ height: number;
35
+ layoutSizingHorizontal: string;
36
+ layoutSizingVertical: string;
37
+ fillType: string;
38
+ positionType: string;
39
+ solidFill: string;
40
+ name: string;
41
+ isPrimary: boolean;
42
+ threshold: number;
43
+ horizontalGrow?: undefined;
44
+ verticalGrow?: undefined;
45
+ renderMode?: undefined;
46
+ overrides?: undefined;
47
+ properties?: undefined;
48
+ };
49
+ };
50
+ //# sourceMappingURL=emptyFragment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emptyFragment.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/emptyFragment.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,eAAgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuClD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const createFetcher: (baseUrl: string, defaultHeaders?: HeadersInit) => {
2
+ query: <T>(query: string, variables?: Record<string, unknown>, options?: RequestInit) => Promise<T>;
3
+ invalidate: (endpoint: string, options?: RequestInit) => void;
4
+ clearCache: () => void;
5
+ };
6
+ //# sourceMappingURL=fetcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetcher.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/fetcher.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa,YACf,MAAM,mBACC,WAAW;YAWN,CAAC,SACb,MAAM,cACF,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACzB,WAAW,KACnB,OAAO,CAAC,CAAC,CAAC;2BAuCiB,MAAM,YAAY,WAAW;;CAO5D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@graph-state/core';
2
+ export declare const fetchPlugin: Plugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAW3C,eAAO,MAAM,WAAW,EAAE,MAqEzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getFragmentQuery: (isSelf?: boolean) => "\nquery FragmentDocument($fragmentSlug: Int!) {\n fragment(fragmentIds: [$fragmentSlug]) {\n id\n document\n linkedFragments {\n id\n document\n }\n }\n}\n" | "\nquery FragmentDocument($fragmentSlug: Int!) {\n clientFragment(fragmentId: $fragmentSlug) {\n id\n document\n linkedFragments {\n id\n document\n }\n }\n}\n";
2
+ //# sourceMappingURL=FragmentQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FragmentQuery.d.ts","sourceRoot":"","sources":["../../../../src/plugins/fetch/queries/FragmentQuery.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,YAAa,OAAO,qbAyBhD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const getLandingQuery: () => string;
2
+ //# sourceMappingURL=LandingQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LandingQuery.d.ts","sourceRoot":"","sources":["../../../../src/plugins/fetch/queries/LandingQuery.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAkB3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@graph-state/core';
2
+ export declare const fragmentsPlugin: Plugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/fragments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMxD,eAAO,MAAM,eAAe,EAAE,MAuE7B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@graph-state/core';
2
+ export declare const metricsPlugin: Plugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAU3C,eAAO,MAAM,aAAa,EAAE,MAkC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const addClientMetric = "mutation AddClientMetric($type: ClientMetricType!, $value: String) {\n addClientMetric(metric: {metricType: $type, metricValue: $value})\n}";
2
+ //# sourceMappingURL=addClientMetric.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addClientMetric.d.ts","sourceRoot":"","sources":["../../../../src/plugins/metrics/queries/addClientMetric.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,iJAE1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const buildCssBlock: (block: any) => string;
2
+ //# sourceMappingURL=buildCssBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCssBlock.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/buildCssBlock.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,wBAIzB,CAAC"}
@@ -0,0 +1,4 @@
1
+ type CSSRules = Record<string, string | number>;
2
+ export declare function compareRules(prev?: CSSRules, next?: CSSRules): CSSRules;
3
+ export {};
4
+ //# sourceMappingURL=compareRules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compareRules.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/compareRules.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEhD,wBAAgB,YAAY,CAC1B,IAAI,GAAE,QAAa,EACnB,IAAI,GAAE,QAAa,GAClB,QAAQ,CAWV"}
@@ -0,0 +1,8 @@
1
+ import { GraphState } from '@graph-state/core';
2
+ export declare const findGroups: (state: GraphState) => {
3
+ fragment: any;
4
+ primary: any;
5
+ smaller: any;
6
+ larger: any;
7
+ }[];
8
+ //# sourceMappingURL=findGroups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findGroups.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/findGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,mBAAmB,CAAC;AAGxD,eAAO,MAAM,UAAU,UAAW,UAAU;;;;;GAoC3C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Entity } from '@graph-state/core';
2
+ export declare const getAllChildren: (state: any, start: Entity, acc?: string[]) => string[];
3
+ //# sourceMappingURL=getAllChildren.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllChildren.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/getAllChildren.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,eAAO,MAAM,cAAc,sBAAkB,MAAM,QAAO,MAAM,EAAE,aAejE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Plugin } from '@graph-state/core';
2
+ export declare const styleSheetPlugin: Plugin;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAMpD,eAAO,MAAM,gBAAgB,EAAE,MAkE9B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Entity, GraphState } from '@graph-state/core';
2
+ export declare const makeCss: (state: GraphState) => (entity: Entity) => {
3
+ hash: string;
4
+ css: string;
5
+ };
6
+ //# sourceMappingURL=makeCss.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeCss.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/makeCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKvD,eAAO,MAAM,OAAO,UAAW,UAAU,cAAc,MAAM;;;CAmB5D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const toCSS: (styles: Record<string, string>) => string;
2
+ //# sourceMappingURL=toCSS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toCSS.d.ts","sourceRoot":"","sources":["../../../src/plugins/styleSheet/toCSS.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,WAAY,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAOrC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@fragmentsx/client-core",
3
+ "private": false,
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.es.js",
14
+ "require": "./dist/index.cjs.js",
15
+ "source": "./src/index.d.ts"
16
+ }
17
+ },
18
+ "dependencies": {
19
+ "@graph-state/checkers": "^0.1.2",
20
+ "@graph-state/core": "^0.11.4",
21
+ "@fragmentsx/definition": "0.0.3",
22
+ "@fragmentsx/utils": "0.0.11"
23
+ },
24
+ "devDependencies": {
25
+ "@graph-state/plugin-logger": "^0.3.0",
26
+ "typescript": "^5.5.4",
27
+ "vite": "^6.1.0",
28
+ "vite-plugin-dts": "^4.5.0",
29
+ "vitest": "^3.1.1"
30
+ },
31
+ "scripts": {
32
+ "clear": "rm -r -f ./dist",
33
+ "build": "vite build",
34
+ "dev": "vite build -w",
35
+ "test": "vitest --run --config ./vitest.config.ts",
36
+ "lint": "eslint . --ext .ts,.tsx --fix"
37
+ }
38
+ }