@octane-xplat/patches 0.11.0 → 0.12.0

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.
@@ -1,93 +0,0 @@
1
- diff --git a/globals.d.ts b/globals.d.ts
2
- new file mode 100644
3
- index 0000000000000000000000000000000000000000..c318cdd81d3bed3f836fafc6fd953a9ab4efcc96
4
- --- /dev/null
5
- +++ b/globals.d.ts
6
- @@ -0,0 +1,65 @@
7
- +/**
8
- + * Ambient declarations for JavaScript globals provided natively by the
9
- + * iOS and Android runtimes (ada-url based, see the runtime URLImpl and
10
- + * URLSearchParamsImpl sources), so they resolve in projects compiled
11
- + * without the DOM lib.
12
- + *
13
- + * The shapes intentionally mirror lib.dom.d.ts so the interfaces merge
14
- + * cleanly when a project also includes the DOM lib. Members that the
15
- + * runtimes do not implement (URL#toJSON, URL.parse, webkitURL, ...) are
16
- + * omitted; the URL constructor requires a string first argument because
17
- + * the runtimes throw a TypeError for anything else.
18
- + */
19
- +interface URL {
20
- + hash: string;
21
- + host: string;
22
- + hostname: string;
23
- + href: string;
24
- + readonly origin: string;
25
- + password: string;
26
- + pathname: string;
27
- + port: string;
28
- + protocol: string;
29
- + search: string;
30
- + readonly searchParams: URLSearchParams;
31
- + username: string;
32
- + toString(): string;
33
- +}
34
- +
35
- +interface URLConstructor {
36
- + new (url: string, base?: string | URL): URL;
37
- + prototype: URL;
38
- + canParse(url: string | URL, base?: string | URL): boolean;
39
- + /**
40
- + * Returns a `blob:nativescript/<uuid>` URL for a Blob/File, or null
41
- + * when the value is not a Blob/File instance.
42
- + */
43
- + createObjectURL(object: any, options?: { ext?: string } | null): string | null;
44
- + revokeObjectURL(url: string): void;
45
- +}
46
- +
47
- +declare var URL: URLConstructor;
48
- +
49
- +interface URLSearchParams {
50
- + readonly size: number;
51
- + append(name: string, value: string): void;
52
- + delete(name: string, value?: string): void;
53
- + get(name: string): string | null;
54
- + getAll(name: string): string[];
55
- + has(name: string, value?: string): boolean;
56
- + set(name: string, value: string): void;
57
- + sort(): void;
58
- + toString(): string;
59
- + forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any): void;
60
- + entries(): IterableIterator<[string, string]>;
61
- + keys(): IterableIterator<string>;
62
- + values(): IterableIterator<string>;
63
- + [Symbol.iterator](): IterableIterator<[string, string]>;
64
- +}
65
- +
66
- +interface URLSearchParamsConstructor {
67
- + new (init?: string | string[][] | Record<string, string> | URLSearchParams | Iterable<readonly [string, string]>): URLSearchParams;
68
- + prototype: URLSearchParams;
69
- +}
70
- +
71
- +declare var URLSearchParams: URLSearchParamsConstructor;
72
- diff --git a/index.d.ts b/index.d.ts
73
- index c1089ccf65220974cf84ab5b362f40715040dbc1..e438317645d8503850d45634e534d1ca6e0bb688 100644
74
- --- a/index.d.ts
75
- +++ b/index.d.ts
76
- @@ -1,2 +1,3 @@
77
- +/// <reference path="./globals.d.ts" />
78
- /// <reference path="../types-android/index.d.ts" />
79
- /// <reference path="../types-ios/index.d.ts" />
80
- diff --git a/package.json b/package.json
81
- index 34579e2a66ffde8c58e9df6829dbfe872f5eb6fd..d5b98c8cf0d0bfcdbddea7f24a3ee0239af12a17 100644
82
- --- a/package.json
83
- +++ b/package.json
84
- @@ -8,7 +8,8 @@
85
- "url": "https://github.com/NativeScript/NativeScript"
86
- },
87
- "files": [
88
- - "index.d.ts"
89
- + "index.d.ts",
90
- + "globals.d.ts"
91
- ],
92
- "license": "Apache-2.0",
93
- "dependencies": {
@@ -1,78 +0,0 @@
1
- diff --git a/src/Context.tsrx b/src/Context.tsrx
2
- index fd5ced72b3ac2e789c3feea4aff73c7c41645c26..92174f36f5e58bef6e7ec0785f7241918cd1a6ee 100644
3
- --- a/src/Context.tsrx
4
- +++ b/src/Context.tsrx
5
- @@ -3,10 +3,24 @@
6
- // render-prop contract with useContext instead.
7
- import { isChildrenBlock, useMemo, type OctaneNode } from 'octane';
8
-
9
- -import { EditorContext, useCurrentEditor, type EditorContextValue } from './Context';
10
- import { EditorContent, type EditorContentProps } from './EditorContent.tsrx';
11
- import { useEditor, type UseEditorOptions } from './useEditor';
12
-
13
- +import type { Editor } from '@tiptap/core';
14
- +import { createContext, useContext } from 'octane';
15
- +
16
- +export type EditorContextValue = {
17
- + editor: Editor | null;
18
- +};
19
- +
20
- +export const EditorContext = createContext<EditorContextValue>({
21
- + editor: null,
22
- +});
23
- +
24
- +export function useCurrentEditor(): EditorContextValue {
25
- + return useContext(EditorContext);
26
- +}
27
- +
28
- export interface EditorConsumerProps {
29
- children: (value: EditorContextValue) => OctaneNode;
30
- }
31
- diff --git a/src/Context.tsrx.d.ts b/src/Context.tsrx.d.ts
32
- index 96c24a2bd79e19fd67532bc92b6f31976f575f95..c99a289a9443251e18552e0c878a204bbbcb6b48 100644
33
- --- a/src/Context.tsrx.d.ts
34
- +++ b/src/Context.tsrx.d.ts
35
- @@ -2,9 +2,16 @@ import type { OctaneNode } from 'octane';
36
- import type { Octane } from 'octane/jsx-runtime';
37
-
38
- import type { EditorContentProps } from './EditorContent.tsrx';
39
- -import type { EditorContextValue } from './Context';
40
- +import type { EditorContextValue } from './Context.ts';
41
- import type { UseEditorOptions } from './useEditor';
42
-
43
- +import type { Editor } from '@tiptap/core';
44
- +import type { Context } from 'octane';
45
- +
46
- +export declare const EditorContext: Context<EditorContextValue>;
47
- +export declare function useCurrentEditor(): EditorContextValue;
48
- +export type { EditorContextValue };
49
- +
50
- export interface EditorConsumerProps {
51
- children: (value: EditorContextValue) => OctaneNode;
52
- }
53
- diff --git a/src/useEditor.ts b/src/useEditor.ts
54
- index c30a55e3889a8dfdd6614a6f03422180bcf3116d..339921dc4c7ce32d7bc56dd5d66615aec682d8de 100644
55
- --- a/src/useEditor.ts
56
- +++ b/src/useEditor.ts
57
- @@ -7,7 +7,8 @@ import { useEditorState, type UseEditorStateOptions } from './useEditorState';
58
- type DependencyList = readonly unknown[];
59
- type MutableRefObject<T> = { current: T };
60
-
61
- -const isDev = process.env.NODE_ENV !== 'production';
62
- +declare const process: { env: { NODE_ENV?: string } };
63
- +const isDev = process.env.NODE_ENV !== 'production';
64
- const isSSR = typeof window === 'undefined';
65
- const isNext = isSSR || Boolean(typeof window !== 'undefined' && (window as any).next);
66
-
67
- diff --git a/src/index.ts b/src/index.ts
68
- --- a/src/index.ts
69
- +++ b/src/index.ts
70
- @@ -1,6 +1,7 @@
71
- 'use client';
72
-
73
- -export * from './Context';
74
- +// './Context' resolves to Context.tsrx under suffix-first resolution — the
75
- +// star-export on the next line already covers it, so this is a duplicate.
76
- export * from './Context.tsrx';
77
- export * from './EditorContent.tsrx';
78
- export * from './NodeViewContent';