@octane-xplat/patches 0.10.0 → 0.11.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octane-xplat/patches",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "description": "pnpm config dependency carrying the framework patch files",
5
5
  "keywords": [
6
6
  "framework",
@@ -0,0 +1,30 @@
1
+ diff --git a/index.ios.js b/index.ios.js
2
+ index 55c24ed3cbcd7eb0b17ddd3ea86f4ba72bf5e8fb..c4d2344fffbcea691c25099548e09a15355795d1 100644
3
+ --- a/index.ios.js
4
+ +++ b/index.ios.js
5
+ @@ -108,6 +108,16 @@ function getContextFromOptions(options) {
6
+ if (transformers.length > 0) {
7
+ context.setValueForKey(SDImagePipelineTransformer.transformerWithTransformers(transformers), SDWebImageContextImageTransformer);
8
+ }
9
+ + if (options.headers) {
10
+ + const requestModifier = SDWebImageDownloaderRequestModifier.requestModifierWithBlock((request) => {
11
+ + const newRequest = request.mutableCopy();
12
+ + Object.keys(options.headers).forEach((k) => {
13
+ + newRequest.addValueForHTTPHeaderField(options.headers[k], k);
14
+ + });
15
+ + return newRequest.copy();
16
+ + });
17
+ + context.setValueForKey(requestModifier, SDWebImageContextDownloadRequestModifier);
18
+ + }
19
+ return context;
20
+ }
21
+ // This is not the best solution as their might be a lot of corner cases
22
+ @@ -177,6 +187,8 @@ export class ImagePipeline {
23
+ prefetchToCacheType(uri, cacheType, options = {}) {
24
+ return new Promise((resolve, reject) => {
25
+ const context = getContextFromOptions(options);
26
+ + context.setObjectForKey(cacheType, SDWebImageContextStoreCacheType);
27
+ + context.setObjectForKey(cacheType, SDWebImageContextOriginalStoreCacheType);
28
+ SDWebImagePrefetcher.sharedImagePrefetcher.context = context;
29
+ SDWebImagePrefetcher.sharedImagePrefetcher.prefetchURLsProgressCompleted([getUri(uri)], null, (finished, skipped) => {
30
+ if (finished && !skipped) {
@@ -1,3 +1,36 @@
1
+ diff --git a/helpers/project.js b/helpers/project.js
2
+ index ef8a029f7e6e66cdeaa344a6af18af28145b8b05..b06cce4f6909d61b538295124ebb1d80a1eb31bf 100644
3
+ --- a/helpers/project.js
4
+ +++ b/helpers/project.js
5
+ @@ -73,7 +73,11 @@ function denoConfigHasWorkspace(dir) {
6
+ * - `lerna.json`
7
+ * - `nx.json` (Nx)
8
+ * - `rush.json` (Rush)
9
+ - * - `turbo.json` (Turborepo)
10
+ + * - `turbo.json` (Turborepo) — NOT self-declaring: Turborepo scatters
11
+ + * per-package `turbo.json` task configs (`"extends": ["//"]`) into every
12
+ + * workspace package, so the file alone marks a package dir, not a root.
13
+ + * Real turbo roots still resolve through their workspace declaration
14
+ + * (`pnpm-workspace.yaml`, `lerna.json`, or `package.json#workspaces`)
15
+ * - `deno.json` / `deno.jsonc` containing a `workspace` field
16
+ * - `package.json` containing a `workspaces` field (npm/yarn workspaces)
17
+ *
18
+ @@ -106,6 +110,15 @@ export function findMonorepoWorkspaceRoot(start = getProjectRootPath()) {
19
+ return current;
20
+ continue;
21
+ }
22
+ + if (marker === 'turbo.json') {
23
+ + // turbo.json is not self-declaring: Turborepo writes
24
+ + // per-package task configs (`"extends": ["//"]`) into
25
+ + // workspace packages, so a lone turbo.json marks a package
26
+ + // dir, not a root. Every real turbo root still resolves —
27
+ + // its workspace is declared by pnpm-workspace.yaml,
28
+ + // lerna.json, or package.json#workspaces.
29
+ + continue;
30
+ + }
31
+ if (existsSync(join(current, marker)))
32
+ return current;
33
+ }
1
34
  diff --git a/helpers/ts-config-paths.js b/helpers/ts-config-paths.js
2
35
  index 27013b5c8f78a72b6e6df903ac36f72fc0d75c1a..53a2e7d489ab91593cbec47ee6fb640fc56c786f 100644
3
36
  --- a/helpers/ts-config-paths.js
@@ -0,0 +1,12 @@
1
+ diff --git a/src/useEditor.ts b/src/useEditor.ts
2
+ index c30a55e..f550fce 100644
3
+ --- a/src/useEditor.ts
4
+ +++ b/src/useEditor.ts
5
+ @@ -7,6 +7,7 @@ import { useEditorState, type UseEditorStateOptions } from './useEditorState';
6
+ type DependencyList = readonly unknown[];
7
+ type MutableRefObject<T> = { current: T };
8
+
9
+ +declare const process: { env: { NODE_ENV?: string } };
10
+ const isDev = process.env.NODE_ENV !== 'production';
11
+ const isSSR = typeof window === 'undefined';
12
+ const isNext = isSSR || Boolean(typeof window !== 'undefined' && (window as any).next);
@@ -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';