diff --git a/app/nextgraph/package.json b/app/nextgraph/package.json index 80126416..6a059116 100644 --- a/app/nextgraph/package.json +++ b/app/nextgraph/package.json @@ -12,7 +12,7 @@ "check": "svelte-check --tsconfig ./tsconfig.json", "webdev": "cross-env NG_ENV_WEB=1 TAURI_DEBUG=1 NG_PUBLIC_DEV=1 vite", "webbuild": "cross-env NG_ENV_WEB=1 NG_ENV_ONEFILE=1 vite build && node prepare-web-file.cjs", - "libwasm": "cd ../.. && cargo install cargo-run-script && cargo run-script libwasm && cd app/nextgraph", + "libwasm": "cd ../.. && cargo install cargo-run-script && cargo run-script libwasm", "buildfrontdev": "pnpm -C ../../infra/ngnet/bootstrap builddev && pnpm -C ../../infra/ngnet/auth builddev && pnpm -C ../../infra/ngnet/redir builddev" }, "dependencies": { diff --git a/app/nextgraph/src-tauri/src/lib.rs b/app/nextgraph/src-tauri/src/lib.rs index ab73162c..2c7319b9 100644 --- a/app/nextgraph/src-tauri/src/lib.rs +++ b/app/nextgraph/src-tauri/src/lib.rs @@ -349,7 +349,7 @@ async fn open_window( config.label = label; config.url = tauri::WebviewUrl::External(url.parse().unwrap()); config.title = title; - let _register_window = tauri::WindowBuilder::from_config(&app, &config) + let _register_window = tauri::WebviewWindowBuilder::from_config(&app, &config) .unwrap() .build() .unwrap(); diff --git a/app/nextgraph/src/main-web.ts b/app/nextgraph/src/main-web.ts index 25bad9bd..0b0e4631 100644 --- a/app/nextgraph/src/main-web.ts +++ b/app/nextgraph/src/main-web.ts @@ -11,7 +11,7 @@ import * as web_api from "@ng-org/lib-wasm"; import {init_api} from "@ng-org/ui-common/api"; init_api(web_api); -const NEW_VERSION = "0.1.2-alpha.1"; +const NEW_VERSION = "0.1.2-alpha.2"; // cleaning old wallets :( try { diff --git a/app/nextgraph/src/native-api.ts b/app/nextgraph/src/native-api.ts index 72ef9d20..23968eea 100644 --- a/app/nextgraph/src/native-api.ts +++ b/app/nextgraph/src/native-api.ts @@ -18,6 +18,7 @@ const mapping = { "wallet_gen_shuffle_for_pazzle_opening": ["pazzle_length"], "wallet_gen_shuffle_for_pin": [], "wallet_open_with_pazzle": ["wallet","pazzle","pin"], + "wallet_open_with_password": ["wallet","password"], "wallet_open_with_mnemonic_words": ["wallet","mnemonic_words","pin"], "wallet_open_with_mnemonic": ["wallet","mnemonic","pin"], "wallet_was_opened": ["opened_wallet"], diff --git a/app/ui-common/package.json b/app/ui-common/package.json index 94d9e9a0..4ce0adbc 100644 --- a/app/ui-common/package.json +++ b/app/ui-common/package.json @@ -55,7 +55,7 @@ "shx": "^0.3.4", "svelte": "^3.54.0", "svelte-check": "^3.0.0", - "svelte-heros-v2": "^0.10.12", + "svelte-heros-v2": "^1.3.0", "svelte-preprocess": "^5.0.3", "svelte-time": "^0.8.0", "tailwindcss": "^3.3.1", diff --git a/app/ui-common/src/api.ts b/app/ui-common/src/api.ts index 283455a5..43743310 100644 --- a/app/ui-common/src/api.ts +++ b/app/ui-common/src/api.ts @@ -23,9 +23,9 @@ let api = createAsyncProxy({},{ export default api; -export const NG_EU_BSP = "https://nextgraph.eu"; +export const NG_EU_BSP = import.meta.env.NG_ENV_ALT ? "https://"+import.meta.env.NG_ENV_ALT : "https://nextgraph.eu"; export const NG_EU_BSP_REGISTER = import.meta.env.PROD -? "https://account.nextgraph.eu/#/create" +? import.meta.env.NG_ENV_ALT_ACCOUNT ? import.meta.env.NG_ENV_ALT_ACCOUNT : "https://account.nextgraph.eu/#/create" : "http://account-dev.nextgraph.eu:5173/#/create"; export const NG_ONE_BSP = "https://nextgraph.one"; diff --git a/app/ui-common/src/lib/Login.svelte b/app/ui-common/src/lib/Login.svelte index bcc45cfa..fd4be2e7 100644 --- a/app/ui-common/src/lib/Login.svelte +++ b/app/ui-common/src/lib/Login.svelte @@ -54,7 +54,6 @@ load_svg(); //console.log(wallet); await init(); - }); async function init() { @@ -256,7 +255,11 @@ } } catch (e) { console.error(e); - if (e.message && e.message.includes("constructor") || (typeof e === "string" && e.includes("constructor") )) e = "BrowserTooOld"; + if ( + (e.message && e.message.includes("constructor")) || + (typeof e === "string" && e.includes("constructor")) + ) + e = "BrowserTooOld"; error = e; step = "end"; dispatch("error", { error: e }); @@ -272,7 +275,10 @@ async function on_pin_key(val) { pin_code = [...pin_code, val]; if (pin_code.length == 4) { - setTimeout(()=>window.document.getElementById("confirm_pin_btn").focus(),50); + setTimeout( + () => window.document.getElementById("confirm_pin_btn").focus(), + 50 + ); } } @@ -590,7 +596,10 @@ class:h-[160px]={!mobile} class:h-[93px]={mobile} class:text-8xl={!mobile} - on:click={async () => {window.document.activeElement.blur(); await on_pin_key(num)}} + on:click={async () => { + window.document.activeElement.blur(); + await on_pin_key(num); + }} disabled={pin_code.length >= 4} > {num} @@ -606,7 +615,10 @@ class:h-[160px]={!mobile} class:h-[93px]={mobile} class:text-8xl={!mobile} - on:click={async () => {window.document.activeElement.blur();await on_pin_key(shuffle_pin[9])}} + on:click={async () => { + window.document.activeElement.blur(); + await on_pin_key(shuffle_pin[9]); + }} disabled={pin_code.length >= 4} > {shuffle_pin[9]} diff --git a/app/ui-common/src/lib/components/PasswordInput.svelte b/app/ui-common/src/lib/components/PasswordInput.svelte index 1470f57c..4b172235 100644 --- a/app/ui-common/src/lib/components/PasswordInput.svelte +++ b/app/ui-common/src/lib/components/PasswordInput.svelte @@ -18,8 +18,8 @@ export let auto_complete: string | undefined = undefined; import { createEventDispatcher } from "svelte"; export let show: boolean = false; - - let input; + export let autofocus = false; + export let input = undefined; let type: "password" | "text" = "password"; $: type = show ? "text" : "password"; @@ -44,7 +44,7 @@ if (e.key == "Enter" || e.keyCode == 13) { dispatch("enter"); } - } + };
- {@html $t("pages.wallet_create.wallet_description")} -
-- {@html $t("pages.wallet_create.select_server")} -
-
{$t("pages.wallet_create.choose_pin.title")}{$t("pages.wallet_create.choose_username.title")}
- {$t("pages.wallet_create.choose_pin.rules")} -
-Rendered in React
-| Key | -Value | -Edit | -
|---|---|---|
| {key} | -- {value instanceof Set - ? Array.from(value).join(", ") - : Array.isArray(value) - ? `[${value.join(", ")}]` - : JSON.stringify(value)} - | -
- {typeof value === "string" ? (
- {
- setNestedValue(
- state,
- key,
- e.target.value
- );
- }}
- />
- ) : typeof value === "number" ? (
- {
- setNestedValue(
- state,
- key,
- Number(e.target.value)
- );
- }}
- />
- ) : typeof value === "boolean" ? (
- {
- setNestedValue(
- state,
- key,
- e.target.checked
- );
- }}
- />
- ) : Array.isArray(value) ? (
-
-
- ) : value instanceof Set ? (
-
-
- ) : (
- "N/A"
- )}
- |
-
| Key | +Value | +Edit | +
|---|---|---|
| {key} | ++ {value instanceof Set + ? Array.from( + value + ).join(", ") + : Array.isArray(value) + ? `[${value.join(", ")}]` + : JSON.stringify( + value + )} + | +
+ {typeof value ===
+ "string" ? (
+ {
+ setNestedValue(
+ parentObj,
+ lastKey,
+ e.target
+ .value
+ );
+ }}
+ />
+ ) : typeof value ===
+ "number" ? (
+ {
+ setNestedValue(
+ parentObj,
+ lastKey,
+ Number(
+ e.target
+ .value
+ )
+ );
+ }}
+ />
+ ) : typeof value ===
+ "boolean" ? (
+ {
+ setNestedValue(
+ parentObj,
+ lastKey,
+ e.target
+ .checked
+ );
+ }}
+ />
+ ) : Array.isArray(value) ? (
+
+
+ ) : value instanceof Set ? (
+
+
+ ) : (
+ "N/A"
+ )}
+ |
+
Rendered in Svelte
-| Key | -Value | -Edit | -
|---|
| {key} | -- {#if value instanceof Set} - {Array.from(value).join(", ")} - {:else if Array.isArray(value)} - [{value.join(", ")}] - {:else} - {JSON.stringify(value)} - {/if} - | -
- {#if typeof value === "string"}
-
- setNestedValue($shapeObject, key, e.target.value)}
- />
- {:else if typeof value === "number"}
-
- setNestedValue($shapeObject, key, Number(e.target.value))}
- />
- {:else if typeof value === "boolean"}
-
- setNestedValue($shapeObject, key, e.target.checked)}
- />
- {:else if Array.isArray(value)}
-
-
- {:else if value instanceof Set}
-
-
- {:else}
- N/A
- {/if}
- |
+ Key | +Value | +Edit |
|---|
Loading state
diff --git a/sdk/js/examples/multi-framework-signals/src/frontends/utils/flattenObject.ts b/sdk/js/examples/multi-framework-signals/src/frontends/utils/flattenObject.ts index 1b55bf3a..bed55f73 100644 --- a/sdk/js/examples/multi-framework-signals/src/frontends/utils/flattenObject.ts +++ b/sdk/js/examples/multi-framework-signals/src/frontends/utils/flattenObject.ts @@ -1,43 +1,75 @@ interface FlattenOptions { - /** Maximum depth to traverse (default: 8). */ - maxDepth?: number; - /** Skip keys that start with a dollar sign (deepSignal meta). Default: true */ - skipDollarKeys?: boolean; + /** Maximum depth to traverse (default: 8). */ + maxDepth?: number; + /** Skip keys that start with a dollar sign (deepSignal meta). Default: true */ + skipDollarKeys?: boolean; } const isPlainObject = (v: any) => - Object.prototype.toString.call(v) === "[object Object]"; + Object.prototype.toString.call(v) === "[object Object]"; const flattenObject = ( - obj: any, - prefix = "", - options: FlattenOptions = {}, - seen = new SetRendered in Vue
- - - - - - -| Key | -Value | -Edit | -||||||
|---|---|---|---|---|---|---|---|---|
| {{ path }} | + +||||
| Key | +Value | +Edit | +||
|---|---|---|---|---|
| {{ path }} | - -- - {{ Array.from(value).join(", ") }} - - - [{{ value.join(", ") }}] - - - {{ JSON.stringify(value) }} - - | + ++ + {{ Array.from(value).join(", ") }} + + + [{{ value.join(", ") }}] + + + {{ JSON.stringify(value) }} + + | - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
- N/A
- |
-
Loading state
diff --git a/sdk/js/examples/multi-framework-signals/src/shapes/orm/basic.schema.ts b/sdk/js/examples/multi-framework-signals/src/shapes/orm/basic.schema.ts new file mode 100644 index 00000000..b1615280 --- /dev/null +++ b/sdk/js/examples/multi-framework-signals/src/shapes/orm/basic.schema.ts @@ -0,0 +1,37 @@ +import type { Schema } from "@ng-org/shex-orm"; + +/** + * ============================================================================= + * basicSchema: Schema for basic + * ============================================================================= + */ +export const basicSchema: Schema = { + "http://example.org/BasicShape": { + iri: "http://example.org/BasicShape", + predicates: [ + { + dataTypes: [ + { + valType: "literal", + literals: ["http://example.org/Basic"], + }, + ], + maxCardinality: 1, + minCardinality: 1, + iri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", + readablePredicate: "@type", + }, + { + dataTypes: [ + { + valType: "string", + }, + ], + maxCardinality: 1, + minCardinality: 1, + iri: "http://example.org/basicString", + readablePredicate: "basicString", + }, + ], + }, +}; diff --git a/sdk/js/examples/multi-framework-signals/src/shapes/orm/basic.shapeTypes.ts b/sdk/js/examples/multi-framework-signals/src/shapes/orm/basic.shapeTypes.ts new file mode 100644 index 00000000..1e537bb6 --- /dev/null +++ b/sdk/js/examples/multi-framework-signals/src/shapes/orm/basic.shapeTypes.ts @@ -0,0 +1,9 @@ +import type { ShapeType } from "@ng-org/shex-orm"; +import { basicSchema } from "./basic.schema"; +import type { Basic } from "./basic.typings"; + +// ShapeTypes for basic +export const BasicShapeType: ShapeType