cleanup and bump ldo version

master
Niko PLP 2 weeks ago
parent 07ec377202
commit 29a35f835a
  1. 182
      ng-sdk-js/example-webapp-react-socialquery/package-lock.json
  2. 10
      ng-sdk-js/example-webapp-react-socialquery/package.json
  3. 93
      ng-sdk-js/example-webapp-react-socialquery/src/Contact.tsx
  4. 8
      ng-sdk-js/example-webapp-react/package.json

@ -9,16 +9,16 @@
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"@heroicons/react": "^2.2.0", "@heroicons/react": "^2.2.0",
"@ldo/connected-nextgraph": "^1.0.0-alpha.11", "@ldo/connected-nextgraph": "^1.0.0-alpha.14",
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/react": "^1.0.0-alpha.11", "@ldo/react": "^1.0.0-alpha.14",
"nextgraphweb": "^0.1.1-alpha.4", "nextgraphweb": "^0.1.1-alpha.4",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.22.0", "@eslint/js": "^9.22.0",
"@ldo/cli": "^1.0.0-alpha.11", "@ldo/cli": "^1.0.0-alpha.14",
"@types/jsonld": "^1.5.15", "@types/jsonld": "^1.5.15",
"@types/react": "^19.0.10", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4", "@types/react-dom": "^19.0.4",
@ -1091,14 +1091,14 @@
} }
}, },
"node_modules/@ldo/cli": { "node_modules/@ldo/cli": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/cli/-/cli-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/cli/-/cli-1.0.0-alpha.14.tgz",
"integrity": "sha512-k/5dVU9tl2goLPN+wGaTmyxm85rj2P1sunBJSCv6CSqsJsi0kYfxjJrbABVlOmnCig104aHd5diXB5hZH4EoEg==", "integrity": "sha512-audIkRpZTxcz4KVHaX0gSaxOIfmbkLRShfyu8bCyd3mw6zmleXVo8t+GI0ngRfa5KWixjMAkfjkXAvU2TMlOYw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/schema-converter-shex": "^1.0.0-alpha.11", "@ldo/schema-converter-shex": "^1.0.0-alpha.14",
"@shexjs/parser": "^1.0.0-alpha.24", "@shexjs/parser": "^1.0.0-alpha.24",
"child-process-promise": "^2.2.1", "child-process-promise": "^2.2.1",
"commander": "^9.3.0", "commander": "^9.3.0",
@ -1125,26 +1125,26 @@
} }
}, },
"node_modules/@ldo/connected": { "node_modules/@ldo/connected": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/connected/-/connected-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/connected/-/connected-1.0.0-alpha.14.tgz",
"integrity": "sha512-C0PxBYpOSrLdCBMrL5CvT/cQ0Zah0IScoYnoX8xdUu5T1JUqXejLYibk7N2G8kQchtodZNimbCR99WGHI4hffA==", "integrity": "sha512-weLoICwLphScRdW9I+2cYxDe1h8G7Axv28yUeFxNC4EVRrJQIIFdqFlAMpwgIkRjFUF69pgTCMTp82P2z1iyow==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/dataset": "^1.0.0-alpha.11", "@ldo/dataset": "^1.0.0-alpha.14",
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/rdf-utils": "^1.0.0-alpha.11" "@ldo/rdf-utils": "^1.0.0-alpha.14"
} }
}, },
"node_modules/@ldo/connected-nextgraph": { "node_modules/@ldo/connected-nextgraph": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/connected-nextgraph/-/connected-nextgraph-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/connected-nextgraph/-/connected-nextgraph-1.0.0-alpha.14.tgz",
"integrity": "sha512-n61mPY/9PYfy+e8+MQmhlxl/e2nyZaVA4arSIjgccRzE+BRWvYH0IKX5lr9Id+tcZE1VG/4GUoK+yK/G1AO5Uw==", "integrity": "sha512-l8CcByqTI75HnYQW9OENtOlO5Q4IVCasFXYi8mfpEXDOnZFIIuc3al4AzcpYHOe46V0RlCSGXpBszrZg9PkHlg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/connected": "^1.0.0-alpha.11", "@ldo/connected": "^1.0.0-alpha.14",
"@ldo/dataset": "^1.0.0-alpha.11", "@ldo/dataset": "^1.0.0-alpha.14",
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/rdf-utils": "^1.0.0-alpha.11", "@ldo/rdf-utils": "^1.0.0-alpha.14",
"@solid-notifications/subscription": "^0.1.2", "@solid-notifications/subscription": "^0.1.2",
"cross-fetch": "^3.1.6", "cross-fetch": "^3.1.6",
"http-link-header": "^1.1.1", "http-link-header": "^1.1.1",
@ -1152,48 +1152,48 @@
} }
}, },
"node_modules/@ldo/dataset": { "node_modules/@ldo/dataset": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/dataset/-/dataset-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/dataset/-/dataset-1.0.0-alpha.14.tgz",
"integrity": "sha512-rgJs/YfRqLJKzR3/a5arfUimt+mU3eGNwnObSAsWoChkBtLWqAMtALADDRnhf8mjzVdCfEp0+X0UyyPrrte/4g==", "integrity": "sha512-YF3Mo4zj9ArSBd4K5E8qxmMToe7UfD1WOp5tyVU2684LU7v1eySV5A4LcP1BImi/YIpUtFxmz0DqypEA57PTHQ==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/rdf-utils": "^1.0.0-alpha.11", "@ldo/rdf-utils": "^1.0.0-alpha.14",
"@rdfjs/dataset": "^1.1.0", "@rdfjs/dataset": "^1.1.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"readable-stream": "^4.2.0" "readable-stream": "^4.2.0"
} }
}, },
"node_modules/@ldo/jsonld-dataset-proxy": { "node_modules/@ldo/jsonld-dataset-proxy": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/jsonld-dataset-proxy/-/jsonld-dataset-proxy-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/jsonld-dataset-proxy/-/jsonld-dataset-proxy-1.0.0-alpha.14.tgz",
"integrity": "sha512-ZmB65u3sdj2gwkFv5hkJLQU0X+fDQfj0NLFR/HokGxRyaPqZHLHwLfZCenRabGq9UtnZ6V2ajVR2XWflEv/MOQ==", "integrity": "sha512-f3lKmBevIynM2eMHijYgbI1c3kR+2Qemdn+8Ac8zC5aeg751Y6/NkMB2Gvy5dEgHusLbVFKKjW6U1aeVmNRvyg==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/rdf-utils": "^1.0.0-alpha.11", "@ldo/rdf-utils": "^1.0.0-alpha.14",
"@ldo/subscribable-dataset": "^1.0.0-alpha.11", "@ldo/subscribable-dataset": "^1.0.0-alpha.14",
"@rdfjs/data-model": "^1.2.0", "@rdfjs/data-model": "^1.2.0",
"@rdfjs/dataset": "^1.1.0", "@rdfjs/dataset": "^1.1.0",
"jsonld2graphobject": "^0.0.4" "jsonld2graphobject": "^0.0.4"
} }
}, },
"node_modules/@ldo/ldo": { "node_modules/@ldo/ldo": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/ldo/-/ldo-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/ldo/-/ldo-1.0.0-alpha.14.tgz",
"integrity": "sha512-3H4CSvORnjQojeDOeqqR31HwZKKAd9pF+jcXeFSOMFeTBAmv0T1qqtsDH04kzBqJivsDPNHqCdCZ1I8Y/B/LnQ==", "integrity": "sha512-EB2TG4TwywQrdVsYnz1mQM+ucoRgoVbwJguxDW5JibfOoqTe3QFeglN56wTL6Kk1T+DTmFv83zYUPVpRK8rclw==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/dataset": "^1.0.0-alpha.11", "@ldo/dataset": "^1.0.0-alpha.14",
"@ldo/jsonld-dataset-proxy": "^1.0.0-alpha.11", "@ldo/jsonld-dataset-proxy": "^1.0.0-alpha.14",
"@ldo/subscribable-dataset": "^1.0.0-alpha.11", "@ldo/subscribable-dataset": "^1.0.0-alpha.14",
"@rdfjs/data-model": "^1.2.0", "@rdfjs/data-model": "^1.2.0",
"buffer": "^6.0.3", "buffer": "^6.0.3",
"readable-stream": "^4.3.0" "readable-stream": "^4.3.0"
} }
}, },
"node_modules/@ldo/rdf-utils": { "node_modules/@ldo/rdf-utils": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/rdf-utils/-/rdf-utils-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/rdf-utils/-/rdf-utils-1.0.0-alpha.14.tgz",
"integrity": "sha512-OJZoiAU3CIuFfq4YShP1PoAWyaz2HWHeae1PoZ7p7ABnu7WIbOV+qORieiVSciWx8n4xee3mm2svWmNdTE3nkQ==", "integrity": "sha512-WBOpn8H5n9CQ6i+vt5jNOZwS7kxituOlt1YHbf404OgbWA87H2QeEO7CBuyiwExnIC7XT8MJ3Dr+m4G+PyIxfA==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@rdfjs/data-model": "^1.2.0", "@rdfjs/data-model": "^1.2.0",
@ -1202,28 +1202,28 @@
} }
}, },
"node_modules/@ldo/react": { "node_modules/@ldo/react": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/react/-/react-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/react/-/react-1.0.0-alpha.14.tgz",
"integrity": "sha512-5yeO6t3bhjIT+Lfe/ioY4MsF3CdaiZT+B/akJ6TXzJOslwJTbEZ7caloN7IAkFQX8TCCY3FzIBWvSE5+lS5AZA==", "integrity": "sha512-C6j04Pn65b2kZ/gBmO/5ND4ayEF7l/AAb7ArpPgWoQMu0QEUCb+0gMNGf7O6+QxWvIteezJCwPX8ELBDmvRb/g==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/connected": "^1.0.0-alpha.11", "@ldo/connected": "^1.0.0-alpha.14",
"@ldo/jsonld-dataset-proxy": "^1.0.0-alpha.11", "@ldo/jsonld-dataset-proxy": "^1.0.0-alpha.14",
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/rdf-utils": "^1.0.0-alpha.11", "@ldo/rdf-utils": "^1.0.0-alpha.14",
"@ldo/subscribable-dataset": "^1.0.0-alpha.11", "@ldo/subscribable-dataset": "^1.0.0-alpha.14",
"@rdfjs/data-model": "^1.2.0", "@rdfjs/data-model": "^1.2.0",
"cross-fetch": "^3.1.6" "cross-fetch": "^3.1.6"
} }
}, },
"node_modules/@ldo/schema-converter-shex": { "node_modules/@ldo/schema-converter-shex": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/schema-converter-shex/-/schema-converter-shex-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/schema-converter-shex/-/schema-converter-shex-1.0.0-alpha.14.tgz",
"integrity": "sha512-ebBBrTCf5inZpv/UmCYrMLlDeRnCcSn06bixyFPhBF8NvG4ZOL8hc7WVnQenumeP13RFsJNlQmiHC2JIKm6k8w==", "integrity": "sha512-UKoSkI1jrP67HX5qgdJwH34YE32o/c3svyQ8UniZ8CU5YJOHOGx91Or4S3x4nXkVGjLtAmcYGskBn16P0Z8MxA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/traverser-shexj": "^1.0.0-alpha.11", "@ldo/traverser-shexj": "^1.0.0-alpha.14",
"dts-dom": "~3.6.0", "dts-dom": "~3.6.0",
"jsonld2graphobject": "^0.0.5" "jsonld2graphobject": "^0.0.5"
} }
@ -1251,50 +1251,57 @@
"uuid": "^8.3.2" "uuid": "^8.3.2"
} }
}, },
"node_modules/@ldo/subscribable-dataset": { "node_modules/@ldo/schema-converter-shex/node_modules/uuid": {
"version": "1.0.0-alpha.11", "version": "8.3.2",
"resolved": "https://registry.npmjs.org/@ldo/subscribable-dataset/-/subscribable-dataset-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-cnV2aTSkCIHaji89IxaKJ3c8BJj8NB/1nroLD2r+yVMFqFOnvxL1EaSkHy5DJOY64n6aUj/YAo0wg7VxKIrQjg==", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "bin": {
"@ldo/dataset": "^1.0.0-alpha.11", "uuid": "dist/bin/uuid"
"@ldo/rdf-utils": "^1.0.0-alpha.11",
"uuid": "^11.1.0"
} }
}, },
"node_modules/@ldo/subscribable-dataset/node_modules/uuid": { "node_modules/@ldo/subscribable-dataset": {
"version": "11.1.0", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", "resolved": "https://registry.npmjs.org/@ldo/subscribable-dataset/-/subscribable-dataset-1.0.0-alpha.14.tgz",
"integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "integrity": "sha512-EqXAfz/9giUjNNukJ2+Q3p8UC/OXrIA2YdRd80Bhs82BFpNn3mTIAuy43kreZ0CM1dOMiPDSxCH8WWsviETekg==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"license": "MIT", "license": "MIT",
"bin": { "dependencies": {
"uuid": "dist/esm/bin/uuid" "@ldo/dataset": "^1.0.0-alpha.14",
"@ldo/rdf-utils": "^1.0.0-alpha.14",
"uuid": "^11.1.0"
} }
}, },
"node_modules/@ldo/traverser-shexj": { "node_modules/@ldo/traverser-shexj": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/traverser-shexj/-/traverser-shexj-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/traverser-shexj/-/traverser-shexj-1.0.0-alpha.14.tgz",
"integrity": "sha512-b+q6xFewYy9lBglKabJmNflddqhFRIMRdsJJZSF3gL7gFfor8udvfRTKvWSu0aEt3uC+/wT+T0vKIxKTEkmYBA==", "integrity": "sha512-2Y/1LFbyRMJnBDWlDh7jrhh41sVGYNy9q1rkXXQ0OeWBjUEgCeSZhtYayOr1oqtVsL6mDxUmMgVAK3MOnO1Ldw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@ldo/type-traverser": "^1.0.0-alpha.11" "@ldo/type-traverser": "^1.0.0-alpha.14"
} }
}, },
"node_modules/@ldo/type-traverser": { "node_modules/@ldo/type-traverser": {
"version": "1.0.0-alpha.11", "version": "1.0.0-alpha.14",
"resolved": "https://registry.npmjs.org/@ldo/type-traverser/-/type-traverser-1.0.0-alpha.11.tgz", "resolved": "https://registry.npmjs.org/@ldo/type-traverser/-/type-traverser-1.0.0-alpha.14.tgz",
"integrity": "sha512-hfn3u47LZzBeboAM6ai3oKD4aoiIYowbELr+y+YGKF1yD1AU9mbxi/xscvt4E/XJkUX993HFfvjZ1BVfZFCN0Q==", "integrity": "sha512-rwpGynZm+pcnOPLV7o7FEhh25gNDQKpwrlHC51/UrrHjK7zIvIs4K6+OkVmsuwsJxcicIdUEmNZv7TJQvy3FMw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"uuid": "^8.3.2" "uuid": "^8.3.2"
} }
}, },
"node_modules/@ldo/type-traverser/node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"dev": true,
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@nodelib/fs.scandir": { "node_modules/@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@ -4151,6 +4158,15 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/jsonld2graphobject/node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"license": "MIT",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/keyv": { "node_modules/keyv": {
"version": "4.5.4", "version": "4.5.4",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
@ -5864,12 +5880,16 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/uuid": { "node_modules/uuid": {
"version": "8.3.2", "version": "11.1.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==",
"funding": [
"https://github.com/sponsors/broofa",
"https://github.com/sponsors/ctavan"
],
"license": "MIT", "license": "MIT",
"bin": { "bin": {
"uuid": "dist/bin/uuid" "uuid": "dist/esm/bin/uuid"
} }
}, },
"node_modules/vite": { "node_modules/vite": {

@ -8,20 +8,20 @@
"build": "tsc --noEmit && vite build", "build": "tsc --noEmit && vite build",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview", "preview": "vite preview",
"build:ldo": "../../../ldo/packages/cli/dist/index.js build --input src/.shapes --output src/.ldo" "build:ldo": "ldo build --input src/.shapes --output src/.ldo"
}, },
"dependencies": { "dependencies": {
"@heroicons/react": "^2.2.0", "@heroicons/react": "^2.2.0",
"@ldo/connected-nextgraph": "^1.0.0-alpha.11", "@ldo/connected-nextgraph": "^1.0.0-alpha.14",
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/react": "^1.0.0-alpha.11", "@ldo/react": "^1.0.0-alpha.14",
"nextgraphweb": "^0.1.1-alpha.4", "nextgraphweb": "^0.1.1-alpha.4",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.22.0", "@eslint/js": "^9.22.0",
"@ldo/cli": "^1.0.0-alpha.11", "@ldo/cli": "^1.0.0-alpha.14",
"@types/jsonld": "^1.5.15", "@types/jsonld": "^1.5.15",
"@types/react": "^19.0.10", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4", "@types/react-dom": "^19.0.4",

@ -1,13 +1,13 @@
import { default as React, FunctionComponent } from "react"; import { default as React, FunctionComponent } from "react";
import { useNextGraphAuth } from "./reactMethods"; import { useNextGraphAuth } from "./reactMethods";
import { SocialContactShapeType } from "./.ldo/contact.shapeTypes.ts"; import { SocialContactShapeType } from "./.ldo/contact.shapeTypes.ts";
import { useSubscribeToResource, useResource, useSubject } from "./reactMethods.ts"; import { useSubscribeToResource, useResource, useSubject, useLdo } from "./reactMethods.ts";
import { StarIcon } from '@heroicons/react/24/solid' import { StarIcon } from '@heroicons/react/24/solid'
import { StarIcon as StarIconOutline, NoSymbolIcon } from '@heroicons/react/24/outline' import { StarIcon as StarIconOutline, NoSymbolIcon } from '@heroicons/react/24/outline'
export const Contact: FunctionComponent = ({nuri}) => { export const Contact: FunctionComponent = ({nuri}) => {
const { session } = useNextGraphAuth(); const { session } = useNextGraphAuth();
const { createData, commitData, changeData } = useLdo();
useResource(session.sessionId && nuri ? nuri : undefined, { subscribe: true }); useResource(session.sessionId && nuri ? nuri : undefined, { subscribe: true });
let contact = useSubject(SocialContactShapeType, session.sessionId && nuri ? nuri.substring(0,53) : undefined); let contact = useSubject(SocialContactShapeType, session.sessionId && nuri ? nuri.substring(0,53) : undefined);
@ -37,46 +37,87 @@ export const Contact: FunctionComponent = ({nuri}) => {
"Automerge", "Automerge",
] ]
const [skills, setSkills] = React.useState([ const [skills, setSkills] = React.useState([ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]);
0,
0,
5,
3,
1,
2,
4,
0,
0,
])
React.useEffect(() => { React.useEffect(() => {
console.log(contact.hasRating?.entries()) //contact.hasRating?.map((r)=> {if (r.skill) console.log(r.rated,r.skill["@id"].substring(24))});
let nextSkills = skills.map((s) => { let nextSkills = skills.map((s) => {
return 0; return 0;
}); });
contact.hasRating?.map((r) => { contact.hasRating?.map((r) => {
nextSkills[ksp_mapping.indexOf(r.skill["@id"].substring(28))] = r.rated +1; nextSkills[ksp_mapping.indexOf(r.skill["@id"].substring(24))] = r.rated +1;
}); });
setSkills(nextSkills); setSkills(nextSkills);
}, [contact]) }, [contact])
if (!session.sessionId || !nuri) return <></>; if (!session.sessionId || !nuri) return <></>;
function rate(skill: number, rating: number) { async function rate(skill: number, rating: number) {
console.log("rate", skill, rating); const nextSkills = [...skills];
const old = skills[skill];
const nextSkills = skills.map((s, i) => { if (old == 0) {
if (i === skill) { if (rating == 0) return;//should happen
if (s == rating) { // we create a new rating
s = s - 1; nextSkills[skill] = rating;
try {
await session.ng.sparql_update(session.sessionId, `PREFIX xskills: <did:ng:x:skills#>
PREFIX ksp: <did:ng:k:skills:programming:>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
INSERT {
<> xskills:hasRating [
a xskills:Rating ;
xskills:rated "${rating-1}"^^xsd:integer ;
xskills:skill ksp:${ksp_mapping[skill]}
].
} WHERE {}`, nuri);
} catch (e) {
console.error(e)
}
} else { } else {
s = rating; if (old == rating) {
nextSkills[skill] = rating - 1;
} else {
nextSkills[skill] = rating;
}
if (nextSkills[skill] == 0) {
// we remove the rating
try { const s = `PREFIX xskills: <did:ng:x:skills#>
PREFIX ksp: <did:ng:k:skills:programming:>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
DELETE {
<> xskills:hasRating ?rating.
?rating a xskills:Rating .
?rating xskills:skill ksp:${ksp_mapping[skill]} .
?rating xskills:rated "${old-1}"^^xsd:integer.
} WHERE { <> xskills:hasRating ?rating .
?rating a xskills:Rating .
?rating xskills:skill ksp:${ksp_mapping[skill]}
}`;
await session.ng.sparql_update(session.sessionId, s, nuri);
} catch (e) {
console.error(e)
} }
return s;
} else { } else {
return s; // we update the rating
try {
await session.ng.sparql_update(session.sessionId, `PREFIX xskills: <did:ng:x:skills#>
PREFIX ksp: <did:ng:k:skills:programming:>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
DELETE {
?rating xskills:rated "${old-1}"^^xsd:integer.
} INSERT {
?rating xskills:rated "${nextSkills[skill]-1}"^^xsd:integer.
}
WHERE { <> xskills:hasRating ?rating .
?rating a xskills:Rating .
?rating xskills:skill ksp:${ksp_mapping[skill]}
}`, nuri);
} catch (e) {
console.error(e)
}
}
} }
});
setSkills(nextSkills); setSkills(nextSkills);
} }
@ -89,14 +130,12 @@ export const Contact: FunctionComponent = ({nuri}) => {
<div className="p-2"> <div className="p-2">
<span className="email"> <span className="email">
{contact.hasEmail} {contact.hasEmail}
{JSON.stringify(contact.hasRating?.entries())}
</span> </span>
</div> </div>
{ {
skills.map( skills.map(
(skill,s) => (skill,s) =>
<div key={s} className="px-2 flex flex-row cursor-pointer text-yellow-500"> <div key={s} className="px-2 flex flex-row cursor-pointer text-yellow-500">
{/* <NoSymbolIcon className="size-6"/> */}
{ {
[...Array(5)].map( [...Array(5)].map(
(e,i) => { (e,i) => {

@ -11,16 +11,16 @@
"build:ldo": "ldo build --input src/.shapes --output src/.ldo" "build:ldo": "ldo build --input src/.shapes --output src/.ldo"
}, },
"dependencies": { "dependencies": {
"@ldo/connected-nextgraph": "^1.0.0-alpha.11", "@ldo/connected-nextgraph": "^1.0.0-alpha.14",
"@ldo/ldo": "^1.0.0-alpha.11", "@ldo/ldo": "^1.0.0-alpha.14",
"@ldo/react": "^1.0.0-alpha.11", "@ldo/react": "^1.0.0-alpha.14",
"nextgraphweb": "^0.1.1-alpha.4", "nextgraphweb": "^0.1.1-alpha.4",
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.22.0", "@eslint/js": "^9.22.0",
"@ldo/cli": "^1.0.0-alpha.11", "@ldo/cli": "^1.0.0-alpha.14",
"@types/jsonld": "^1.5.15", "@types/jsonld": "^1.5.15",
"@types/react": "^19.0.10", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4", "@types/react-dom": "^19.0.4",

Loading…
Cancel
Save