@multiplatform.one/platform 9.17.0 → 10.1.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.
- package/dist/cjs/config/config.cjs +63 -76
- package/dist/cjs/config/config.native.cjs +150 -0
- package/dist/cjs/config/config.storybook-expo.cjs +64 -73
- package/dist/cjs/config/config.storybook-expo.native.cjs +144 -0
- package/dist/cjs/config/devOrigin.cjs +23 -25
- package/dist/cjs/config/devOrigin.native.cjs +43 -0
- package/dist/cjs/config/devOriginSource.cjs +15 -21
- package/dist/cjs/config/devOriginSource.native.cjs +40 -0
- package/dist/cjs/config/index.cjs +14 -18
- package/dist/cjs/config/index.native.cjs +31 -0
- package/dist/cjs/config/runtimeConfig.cjs +63 -65
- package/dist/cjs/config/runtimeConfig.native.cjs +108 -0
- package/dist/cjs/config/types.cjs +9 -11
- package/dist/cjs/config/types.native.cjs +18 -0
- package/dist/cjs/file/index.cjs +15 -17
- package/dist/cjs/file/index.native.cjs +30 -0
- package/dist/cjs/file/saveFile.cjs +24 -34
- package/dist/cjs/file/saveFile.native.cjs +127 -0
- package/dist/cjs/file/types.cjs +39 -41
- package/dist/cjs/file/types.native.cjs +174 -0
- package/dist/cjs/helpers.cjs +38 -42
- package/dist/cjs/helpers.native.cjs +67 -0
- package/dist/cjs/index.cjs +35 -60
- package/dist/cjs/index.gnome.cjs +71 -96
- package/dist/cjs/index.gnome.native.cjs +110 -0
- package/dist/cjs/index.native.cjs +60 -0
- package/dist/cjs/platform/index.android.cjs +34 -0
- package/dist/cjs/platform/index.android.js +36 -0
- package/dist/cjs/platform/index.android.js.map +1 -0
- package/dist/cjs/platform/index.cjs +28 -32
- package/dist/cjs/platform/index.gnome.cjs +34 -45
- package/dist/cjs/platform/index.gnome.native.cjs +50 -0
- package/dist/cjs/platform/index.ios.cjs +34 -0
- package/dist/cjs/platform/index.ios.js +36 -0
- package/dist/cjs/platform/index.ios.js.map +1 -0
- package/dist/cjs/platform/index.native.cjs +58 -0
- package/dist/cjs/platform/index.tauri.cjs +30 -36
- package/dist/cjs/platform/index.tauri.native.cjs +49 -0
- package/dist/cjs/platform/platformBase.cjs +75 -63
- package/dist/cjs/platform/platformBase.native.cjs +129 -0
- package/dist/cjs/types.cjs +9 -11
- package/dist/cjs/types.native.cjs +18 -0
- package/dist/cjs/utils/clipboard.cjs +20 -24
- package/dist/cjs/utils/clipboard.native.cjs +34 -0
- package/dist/cjs/utils/cookie.cjs +30 -37
- package/dist/cjs/utils/cookie.native.cjs +40 -0
- package/dist/cjs/utils/downloadFile.cjs +30 -32
- package/dist/cjs/utils/downloadFile.native.cjs +34 -0
- package/dist/cjs/utils/lifecycle.cjs +34 -36
- package/dist/cjs/utils/lifecycle.native.cjs +62 -0
- package/dist/cjs/utils/openUrl.cjs +15 -19
- package/dist/cjs/utils/openUrl.native.cjs +29 -0
- package/dist/esm/config/config.mjs +52 -59
- package/dist/esm/config/config.mjs.map +1 -1
- package/dist/esm/config/config.storybook-expo.mjs +50 -48
- package/dist/esm/config/config.storybook-expo.mjs.map +1 -1
- package/dist/esm/config/devOrigin.mjs +10 -8
- package/dist/esm/config/devOrigin.mjs.map +1 -1
- package/dist/esm/config/devOriginSource.mjs +2 -3
- package/dist/esm/config/devOriginSource.mjs.map +1 -1
- package/dist/esm/config/index.mjs +8 -3
- package/dist/esm/config/index.mjs.map +1 -1
- package/dist/esm/config/runtimeConfig.mjs +43 -42
- package/dist/esm/config/runtimeConfig.mjs.map +1 -1
- package/dist/esm/config/types.mjs +0 -2
- package/dist/esm/file/index.mjs +2 -2
- package/dist/esm/file/saveFile.mjs +12 -16
- package/dist/esm/file/saveFile.mjs.map +1 -1
- package/dist/esm/file/types.mjs +25 -24
- package/dist/esm/file/types.mjs.map +1 -1
- package/dist/esm/helpers.mjs +23 -23
- package/dist/esm/helpers.mjs.map +1 -1
- package/dist/esm/index.gnome.mjs +24 -45
- package/dist/esm/index.gnome.mjs.map +1 -1
- package/dist/esm/index.mjs +21 -33
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/platform/index.android.js +13 -0
- package/dist/esm/platform/index.android.js.map +1 -0
- package/dist/esm/platform/index.gnome.mjs +22 -27
- package/dist/esm/platform/index.gnome.mjs.map +1 -1
- package/dist/esm/platform/index.ios.js +13 -0
- package/dist/esm/platform/index.ios.js.map +1 -0
- package/dist/esm/platform/index.mjs +16 -14
- package/dist/esm/platform/index.mjs.map +1 -1
- package/dist/esm/platform/index.tauri.mjs +19 -19
- package/dist/esm/platform/index.tauri.mjs.map +1 -1
- package/dist/esm/platform/platformBase.mjs +62 -46
- package/dist/esm/platform/platformBase.mjs.map +1 -1
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/utils/clipboard.mjs +7 -6
- package/dist/esm/utils/clipboard.mjs.map +1 -1
- package/dist/esm/utils/cookie.mjs +15 -19
- package/dist/esm/utils/cookie.mjs.map +1 -1
- package/dist/esm/utils/downloadFile.mjs +16 -15
- package/dist/esm/utils/downloadFile.mjs.map +1 -1
- package/dist/esm/utils/lifecycle.mjs +17 -16
- package/dist/esm/utils/lifecycle.mjs.map +1 -1
- package/dist/esm/utils/openUrl.mjs +2 -1
- package/dist/esm/utils/openUrl.mjs.map +1 -1
- package/package.json +8 -8
- package/src/file/saveFile.native.ts +1 -1
- package/src/platform/index.tauri.ts +1 -1
- package/src/platform/platformBase.ts +1 -1
- package/dist/esm/config/types.mjs.map +0 -1
- package/dist/esm/file/index.mjs.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"saveFile.js","names":[],"sources":["esm/file/saveFile.js"],"sourcesContent":["import { downloadBlob } from \"../utils/downloadFile\";\nimport { FileSaveError, prepareFileSave } from \"./types\";\nasync function saveFile(options) {\n const input = prepareFileSave(options);\n if (typeof document === \"undefined\" || !document.body || typeof Blob === \"undefined\" || typeof URL === \"undefined\" || typeof URL.createObjectURL !== \"function\" || typeof URL.revokeObjectURL !== \"function\" || !(\"download\" in document.createElement(\"a\"))) {\n throw new FileSaveError(\"unavailable\", \"Browser file downloads are unavailable.\");\n }\n try {\n downloadBlob(new Blob([input.bytes], { type: input.mimeType }), input.filename);\n } catch (cause) {\n throw new FileSaveError(\"write-failed\", \"The browser download could not be requested.\", {\n cause\n });\n }\n return { status: \"download-requested\" };\n}\nexport {\n saveFile\n};\n//# sourceMappingURL=saveFile.js.map\n"],"mappings":";;;;AAEA,eAAe,SAAS,SAAS;CAC/B,MAAM,QAAQ,gBAAgB,OAAO;CACrC,IAAI,OAAO,aAAa,eAAe,CAAC,SAAS,QAAQ,OAAO,SAAS,eAAe,OAAO,QAAQ,eAAe,OAAO,IAAI,oBAAoB,cAAc,OAAO,IAAI,oBAAoB,cAAc,EAAE,cAAc,SAAS,cAAc,GAAG,IAAI;EAC5P,MAAM,IAAI,cAAc,eAAe,yCAAyC;CAClF;CACA,IAAI;EACF,aAAa,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,MAAM,MAAM,SAAS,CAAC,GAAG,MAAM,QAAQ;CAChF,SAAS,OAAO;EACd,MAAM,IAAI,cAAc,gBAAgB,gDAAgD,EACtF,MACF,CAAC;CACH;CACA,OAAO,EAAE,QAAQ,qBAAqB;AACxC"}
|
package/dist/esm/file/types.mjs
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
var FileSaveError = class extends Error {
|
|
2
|
+
code;
|
|
3
|
+
cleanupError;
|
|
4
|
+
constructor(code, message, options) {
|
|
5
|
+
super(message, options);
|
|
6
|
+
this.name = "FileSaveError";
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.cleanupError = options?.cleanupError;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
11
|
function hasControlCharacters(value) {
|
|
12
|
-
|
|
12
|
+
return Array.from(value).some((character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127);
|
|
13
13
|
}
|
|
14
14
|
function prepareFileSave(options) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
if (!options || !(options.bytes instanceof Uint8Array) || typeof options.filename !== "string" || !options.filename.trim() || options.filename === "." || options.filename === ".." || /[/\\]/.test(options.filename) || hasControlCharacters(options.filename) || typeof options.mimeType !== "string" || hasControlCharacters(options.mimeType)) {
|
|
16
|
+
throw new FileSaveError("invalid-input", "Provide bytes, a single filename and a MIME type.");
|
|
17
|
+
}
|
|
18
|
+
const nativeMimeType = options.mimeType.split(";", 1)[0].trim();
|
|
19
|
+
if (!/^[\w!#$%&'*+.^`|~-]+\/[\w!#$%&'*+.^`|~-]+$/.test(nativeMimeType)) {
|
|
20
|
+
throw new FileSaveError("invalid-input", "Provide a MIME type with a type and subtype.");
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
bytes: Uint8Array.from(options.bytes),
|
|
24
|
+
filename: options.filename,
|
|
25
|
+
mimeType: options.mimeType,
|
|
26
|
+
nativeMimeType
|
|
27
|
+
};
|
|
28
28
|
}
|
|
29
|
+
|
|
29
30
|
export { FileSaveError, prepareFileSave };
|
|
30
31
|
//# sourceMappingURL=types.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["esm/file/types.js"],"sourcesContent":["class FileSaveError extends Error {\n code;\n cleanupError;\n constructor(code, message, options) {\n super(message, options);\n this.name = \"FileSaveError\";\n this.code = code;\n this.cleanupError = options?.cleanupError;\n }\n}\nfunction hasControlCharacters(value) {\n return Array.from(value).some(\n (character) => character.charCodeAt(0) < 32 || character.charCodeAt(0) === 127\n );\n}\nfunction prepareFileSave(options) {\n if (!options || !(options.bytes instanceof Uint8Array) || typeof options.filename !== \"string\" || !options.filename.trim() || options.filename === \".\" || options.filename === \"..\" || /[/\\\\]/.test(options.filename) || hasControlCharacters(options.filename) || typeof options.mimeType !== \"string\" || hasControlCharacters(options.mimeType)) {\n throw new FileSaveError(\"invalid-input\", \"Provide bytes, a single filename and a MIME type.\");\n }\n const nativeMimeType = options.mimeType.split(\";\", 1)[0].trim();\n if (!/^[\\w!#$%&'*+.^`|~-]+\\/[\\w!#$%&'*+.^`|~-]+$/.test(nativeMimeType)) {\n throw new FileSaveError(\"invalid-input\", \"Provide a MIME type with a type and subtype.\");\n }\n return {\n bytes: Uint8Array.from(options.bytes),\n filename: options.filename,\n mimeType: options.mimeType,\n nativeMimeType\n };\n}\nexport {\n FileSaveError,\n prepareFileSave\n};\n//# sourceMappingURL=types.js.map\n"],"mappings":";AAAA,IAAM,gBAAN,cAA4B,MAAM;CAChC;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EAClC,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,eAAe,SAAS;CAC/B;AACF;AACA,SAAS,qBAAqB,OAAO;CACnC,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,MACtB,cAAc,UAAU,WAAW,CAAC,IAAI,MAAM,UAAU,WAAW,CAAC,MAAM,GAC7E;AACF;AACA,SAAS,gBAAgB,SAAS;CAChC,IAAI,CAAC,WAAW,EAAE,QAAQ,iBAAiB,eAAe,OAAO,QAAQ,aAAa,YAAY,CAAC,QAAQ,SAAS,KAAK,KAAK,QAAQ,aAAa,OAAO,QAAQ,aAAa,QAAQ,QAAQ,KAAK,QAAQ,QAAQ,KAAK,qBAAqB,QAAQ,QAAQ,KAAK,OAAO,QAAQ,aAAa,YAAY,qBAAqB,QAAQ,QAAQ,GAAG;EACjV,MAAM,IAAI,cAAc,iBAAiB,mDAAmD;CAC9F;CACA,MAAM,iBAAiB,QAAQ,SAAS,MAAM,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK;CAC9D,IAAI,CAAC,6CAA6C,KAAK,cAAc,GAAG;EACtE,MAAM,IAAI,cAAc,iBAAiB,8CAA8C;CACzF;CACA,OAAO;EACL,OAAO,WAAW,KAAK,QAAQ,KAAK;EACpC,UAAU,QAAQ;EAClB,UAAU,QAAQ;EAClB;CACF;AACF"}
|
package/dist/esm/helpers.mjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
|
|
2
3
|
const isPerformanceNow = typeof performance !== "undefined" && performance.now;
|
|
3
4
|
const date = isPerformanceNow ? performance : Date;
|
|
4
5
|
let _previousUnique;
|
|
5
6
|
function fastUnique() {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
let unique = date.now();
|
|
8
|
+
while (unique === _previousUnique) {
|
|
9
|
+
unique = date.now();
|
|
10
|
+
}
|
|
11
|
+
_previousUnique = unique;
|
|
12
|
+
if (isPerformanceNow) return Date.now() + unique.toString();
|
|
13
|
+
return unique.toString();
|
|
13
14
|
}
|
|
14
15
|
function isText(children) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (Array.isArray(children)) {
|
|
17
|
+
return children.length > 1 && typeof children[0] === "string" && "_owner" in children[1] && "_store" in children[1] && "key" in children[1] && "props" in children[1] && "ref" in children[1] && "type" in children[1];
|
|
18
|
+
}
|
|
19
|
+
return typeof children === "string";
|
|
19
20
|
}
|
|
20
21
|
function createWithLayout(Layout, extraLayouts = [], layoutProps) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}), extraLayouts);
|
|
28
|
-
};
|
|
22
|
+
return ((Component) => {
|
|
23
|
+
return flattenLayouts((props) => /* @__PURE__ */ jsx(Layout, {
|
|
24
|
+
...layoutProps,
|
|
25
|
+
children: /* @__PURE__ */ jsx(Component, { ...props })
|
|
26
|
+
}), extraLayouts);
|
|
27
|
+
});
|
|
29
28
|
}
|
|
30
|
-
function flattenLayouts(layout, [...layouts]) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
function flattenLayouts(layout, [ ...layouts]) {
|
|
30
|
+
const currentLayout = layouts.pop();
|
|
31
|
+
if (!currentLayout) return layout;
|
|
32
|
+
return flattenLayouts(currentLayout(layout), layouts);
|
|
34
33
|
}
|
|
35
34
|
const isDev = process.env.NODE_ENV === "development" || typeof __DEV__ !== "undefined" && __DEV__;
|
|
35
|
+
|
|
36
36
|
export { createWithLayout, fastUnique, isDev, isText };
|
|
37
37
|
//# sourceMappingURL=helpers.mjs.map
|
package/dist/esm/helpers.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":[],"sources":["esm/helpers.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nconst isPerformanceNow = typeof performance !== \"undefined\" && performance.now;\nconst date = isPerformanceNow ? performance : Date;\nlet _previousUnique;\nfunction fastUnique() {\n let unique = date.now();\n while (unique === _previousUnique) {\n unique = date.now();\n }\n _previousUnique = unique;\n if (isPerformanceNow) return Date.now() + unique.toString();\n return unique.toString();\n}\nfunction isText(children) {\n if (Array.isArray(children)) {\n return children.length > 1 && typeof children[0] === \"string\" && \"_owner\" in children[1] && \"_store\" in children[1] && \"key\" in children[1] && \"props\" in children[1] && \"ref\" in children[1] && \"type\" in children[1];\n }\n return typeof children === \"string\";\n}\nfunction createWithLayout(Layout, extraLayouts = [], layoutProps) {\n return ((Component) => {\n return flattenLayouts(\n (props) => /* @__PURE__ */ jsx(Layout, { ...layoutProps, children: /* @__PURE__ */ jsx(Component, { ...props }) }),\n extraLayouts\n );\n });\n}\nfunction flattenLayouts(layout, [...layouts]) {\n const currentLayout = layouts.pop();\n if (!currentLayout) return layout;\n return flattenLayouts(currentLayout(layout), layouts);\n}\nconst isDev = process.env.NODE_ENV === \"development\" || typeof __DEV__ !== \"undefined\" && __DEV__;\nexport {\n createWithLayout,\n fastUnique,\n isDev,\n isText\n};\n//# sourceMappingURL=helpers.js.map\n"],"mappings":";;;AACA,MAAM,mBAAmB,OAAO,gBAAgB,eAAe,YAAY;AAC3E,MAAM,OAAO,mBAAmB,cAAc;AAC9C,IAAI;AACJ,SAAS,aAAa;CACpB,IAAI,SAAS,KAAK,IAAI;CACtB,OAAO,WAAW,iBAAiB;EACjC,SAAS,KAAK,IAAI;CACpB;CACA,kBAAkB;CAClB,IAAI,kBAAkB,OAAO,KAAK,IAAI,IAAI,OAAO,SAAS;CAC1D,OAAO,OAAO,SAAS;AACzB;AACA,SAAS,OAAO,UAAU;CACxB,IAAI,MAAM,QAAQ,QAAQ,GAAG;EAC3B,OAAO,SAAS,SAAS,KAAK,OAAO,SAAS,OAAO,YAAY,YAAY,SAAS,MAAM,YAAY,SAAS,MAAM,SAAS,SAAS,MAAM,WAAW,SAAS,MAAM,SAAS,SAAS,MAAM,UAAU,SAAS;CACtN;CACA,OAAO,OAAO,aAAa;AAC7B;AACA,SAAS,iBAAiB,QAAQ,eAAe,CAAC,GAAG,aAAa;CAChE,SAAS,cAAc;EACrB,OAAO,gBACJ,UAA0B,oBAAI,QAAQ;GAAE,GAAG;GAAa,UAA0B,oBAAI,WAAW,EAAE,GAAG,MAAM,CAAC;EAAE,CAAC,GACjH,YACF;CACF;AACF;AACA,SAAS,eAAe,QAAQ,EAAC,GAAG,UAAU;CAC5C,MAAM,gBAAgB,QAAQ,IAAI;CAClC,IAAI,CAAC,eAAe,OAAO;CAC3B,OAAO,eAAe,cAAc,MAAM,GAAG,OAAO;AACtD;AACA,MAAM,QAAQ,QAAQ,IAAI,aAAa,iBAAiB,OAAO,YAAY,eAAe"}
|
package/dist/esm/index.gnome.mjs
CHANGED
|
@@ -1,73 +1,52 @@
|
|
|
1
1
|
import { platform } from "./platform/index.gnome.mjs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
isBrowser,
|
|
5
|
-
isChrome,
|
|
6
|
-
isChromeExtension,
|
|
7
|
-
isClient,
|
|
8
|
-
isExpo,
|
|
9
|
-
isFirefox,
|
|
10
|
-
isFirefoxExtension,
|
|
11
|
-
isGnome,
|
|
12
|
-
isIframe,
|
|
13
|
-
isIos,
|
|
14
|
-
isNative,
|
|
15
|
-
isNext,
|
|
16
|
-
isServer,
|
|
17
|
-
isStorybook,
|
|
18
|
-
isTauri,
|
|
19
|
-
isDesktop,
|
|
20
|
-
isTouchable,
|
|
21
|
-
isWeb,
|
|
22
|
-
isWebExtension,
|
|
23
|
-
isWebTouchable,
|
|
24
|
-
isWindowDefined
|
|
25
|
-
} = platform;
|
|
2
|
+
|
|
3
|
+
const { isAndroid, isBrowser, isChrome, isChromeExtension, isClient, isExpo, isFirefox, isFirefoxExtension, isGnome, isIframe, isIos, isNative, isNext, isServer, isStorybook, isTauri, isDesktop, isTouchable, isWeb, isWebExtension, isWebTouchable, isWindowDefined } = platform;
|
|
26
4
|
function downloadBlob(_blob, _filename) {
|
|
27
|
-
|
|
5
|
+
console.warn("[gnome] downloadBlob is not available on GNOME");
|
|
28
6
|
}
|
|
29
7
|
function openUrl(url, _target) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
8
|
+
try {
|
|
9
|
+
const gio = globalThis.imports?.gi?.Gio;
|
|
10
|
+
if (gio?.AppInfo?.launch_default_for_uri) {
|
|
11
|
+
gio.AppInfo.launch_default_for_uri(url, null);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
} catch {}
|
|
15
|
+
console.warn(`[gnome] openUrl could not launch a browser for ${url}`);
|
|
38
16
|
}
|
|
39
17
|
function downloadFile(_url, _filename) {
|
|
40
|
-
|
|
18
|
+
console.warn("[gnome] downloadFile is not available on GNOME");
|
|
41
19
|
}
|
|
42
20
|
async function writeToClipboard(_text) {
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
console.warn("[gnome] writeToClipboard is not wired to the GTK clipboard yet");
|
|
22
|
+
return false;
|
|
45
23
|
}
|
|
46
24
|
const lifecycleNoop = () => {};
|
|
47
25
|
function onAppFocus(_callback) {
|
|
48
|
-
|
|
26
|
+
return lifecycleNoop;
|
|
49
27
|
}
|
|
50
28
|
function onAppBlur(_callback) {
|
|
51
|
-
|
|
29
|
+
return lifecycleNoop;
|
|
52
30
|
}
|
|
53
31
|
function onOnline(_callback) {
|
|
54
|
-
|
|
32
|
+
return lifecycleNoop;
|
|
55
33
|
}
|
|
56
34
|
function onOffline(_callback) {
|
|
57
|
-
|
|
35
|
+
return lifecycleNoop;
|
|
58
36
|
}
|
|
59
37
|
function onVisibilityChange(_callback) {
|
|
60
|
-
|
|
38
|
+
return lifecycleNoop;
|
|
61
39
|
}
|
|
62
|
-
const cookieJar = /* @__PURE__ */new Map();
|
|
40
|
+
const cookieJar = /* @__PURE__ */ new Map();
|
|
63
41
|
function getCookie(name) {
|
|
64
|
-
|
|
42
|
+
return cookieJar.get(name);
|
|
65
43
|
}
|
|
66
44
|
function setCookie(name, value, _options) {
|
|
67
|
-
|
|
45
|
+
cookieJar.set(name, value);
|
|
68
46
|
}
|
|
69
47
|
function deleteCookie(name) {
|
|
70
|
-
|
|
48
|
+
cookieJar.delete(name);
|
|
71
49
|
}
|
|
50
|
+
|
|
72
51
|
export { deleteCookie, downloadBlob, downloadFile, getCookie, isAndroid, isBrowser, isChrome, isChromeExtension, isClient, isDesktop, isExpo, isFirefox, isFirefoxExtension, isGnome, isIframe, isIos, isNative, isNext, isServer, isStorybook, isTauri, isTouchable, isWeb, isWebExtension, isWebTouchable, isWindowDefined, onAppBlur, onAppFocus, onOffline, onOnline, onVisibilityChange, openUrl, platform, setCookie, writeToClipboard };
|
|
73
52
|
//# sourceMappingURL=index.gnome.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.gnome.js","names":[],"sources":["esm/index.gnome.js"],"sourcesContent":["import { platform } from \"./platform/index.gnome\";\nconst {\n isAndroid,\n isBrowser,\n isChrome,\n isChromeExtension,\n isClient,\n isExpo,\n isFirefox,\n isFirefoxExtension,\n isGnome,\n isIframe,\n isIos,\n isNative,\n isNext,\n isServer,\n isStorybook,\n isTauri,\n isDesktop,\n isTouchable,\n isWeb,\n isWebExtension,\n isWebTouchable,\n isWindowDefined\n} = platform;\nfunction downloadBlob(_blob, _filename) {\n console.warn(\"[gnome] downloadBlob is not available on GNOME\");\n}\nfunction openUrl(url, _target) {\n try {\n const gio = globalThis.imports?.gi?.Gio;\n if (gio?.AppInfo?.launch_default_for_uri) {\n gio.AppInfo.launch_default_for_uri(url, null);\n return;\n }\n } catch {\n }\n console.warn(`[gnome] openUrl could not launch a browser for ${url}`);\n}\nfunction downloadFile(_url, _filename) {\n console.warn(\"[gnome] downloadFile is not available on GNOME\");\n}\nasync function writeToClipboard(_text) {\n console.warn(\"[gnome] writeToClipboard is not wired to the GTK clipboard yet\");\n return false;\n}\nconst lifecycleNoop = () => {\n};\nfunction onAppFocus(_callback) {\n return lifecycleNoop;\n}\nfunction onAppBlur(_callback) {\n return lifecycleNoop;\n}\nfunction onOnline(_callback) {\n return lifecycleNoop;\n}\nfunction onOffline(_callback) {\n return lifecycleNoop;\n}\nfunction onVisibilityChange(_callback) {\n return lifecycleNoop;\n}\nconst cookieJar = /* @__PURE__ */ new Map();\nfunction getCookie(name) {\n return cookieJar.get(name);\n}\nfunction setCookie(name, value, _options) {\n cookieJar.set(name, value);\n}\nfunction deleteCookie(name) {\n cookieJar.delete(name);\n}\nexport {\n deleteCookie,\n downloadBlob,\n downloadFile,\n getCookie,\n isAndroid,\n isBrowser,\n isChrome,\n isChromeExtension,\n isClient,\n isDesktop,\n isExpo,\n isFirefox,\n isFirefoxExtension,\n isGnome,\n isIframe,\n isIos,\n isNative,\n isNext,\n isServer,\n isStorybook,\n isTauri,\n isTouchable,\n isWeb,\n isWebExtension,\n isWebTouchable,\n isWindowDefined,\n onAppBlur,\n onAppFocus,\n onOffline,\n onOnline,\n onVisibilityChange,\n openUrl,\n platform,\n setCookie,\n writeToClipboard\n};\n//# sourceMappingURL=index.gnome.js.map\n"],"mappings":";;;AACA,MAAM,EACJ,WACA,WACA,UACA,mBACA,UACA,QACA,WACA,oBACA,SACA,UACA,OACA,UACA,QACA,UACA,aACA,SACA,WACA,aACA,OACA,gBACA,gBACA,oBACE;AACJ,SAAS,aAAa,OAAO,WAAW;CACtC,QAAQ,KAAK,gDAAgD;AAC/D;AACA,SAAS,QAAQ,KAAK,SAAS;CAC7B,IAAI;EACF,MAAM,MAAM,WAAW,SAAS,IAAI;EACpC,IAAI,KAAK,SAAS,wBAAwB;GACxC,IAAI,QAAQ,uBAAuB,KAAK,IAAI;GAC5C;EACF;CACF,QAAQ,CACR;CACA,QAAQ,KAAK,kDAAkD,KAAK;AACtE;AACA,SAAS,aAAa,MAAM,WAAW;CACrC,QAAQ,KAAK,gDAAgD;AAC/D;AACA,eAAe,iBAAiB,OAAO;CACrC,QAAQ,KAAK,gEAAgE;CAC7E,OAAO;AACT;AACA,MAAM,sBAAsB,CAC5B;AACA,SAAS,WAAW,WAAW;CAC7B,OAAO;AACT;AACA,SAAS,UAAU,WAAW;CAC5B,OAAO;AACT;AACA,SAAS,SAAS,WAAW;CAC3B,OAAO;AACT;AACA,SAAS,UAAU,WAAW;CAC5B,OAAO;AACT;AACA,SAAS,mBAAmB,WAAW;CACrC,OAAO;AACT;AACA,MAAM,4BAA4B,IAAI,IAAI;AAC1C,SAAS,UAAU,MAAM;CACvB,OAAO,UAAU,IAAI,IAAI;AAC3B;AACA,SAAS,UAAU,MAAM,OAAO,UAAU;CACxC,UAAU,IAAI,MAAM,KAAK;AAC3B;AACA,SAAS,aAAa,MAAM;CAC1B,UAAU,OAAO,IAAI;AACvB"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,36 +1,24 @@
|
|
|
1
1
|
import { platform } from "./platform/index.mjs";
|
|
2
|
-
|
|
3
|
-
export * from "./
|
|
4
|
-
|
|
5
|
-
export * from "./
|
|
6
|
-
|
|
7
|
-
export * from "./
|
|
8
|
-
|
|
9
|
-
export * from "./
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
isNative,
|
|
24
|
-
isNext,
|
|
25
|
-
isServer,
|
|
26
|
-
isStorybook,
|
|
27
|
-
isTauri,
|
|
28
|
-
isDesktop,
|
|
29
|
-
isTouchable,
|
|
30
|
-
isWeb,
|
|
31
|
-
isWebExtension,
|
|
32
|
-
isWebTouchable,
|
|
33
|
-
isWindowDefined
|
|
34
|
-
} = platform;
|
|
2
|
+
|
|
3
|
+
export * from "./platform/index.mjs"
|
|
4
|
+
|
|
5
|
+
export * from "./helpers.mjs"
|
|
6
|
+
|
|
7
|
+
export * from "./types.mjs"
|
|
8
|
+
|
|
9
|
+
export * from "./config/index.mjs"
|
|
10
|
+
|
|
11
|
+
export * from "./utils/cookie.mjs"
|
|
12
|
+
|
|
13
|
+
export * from "./utils/downloadFile.mjs"
|
|
14
|
+
|
|
15
|
+
export * from "./utils/clipboard.mjs"
|
|
16
|
+
|
|
17
|
+
export * from "./utils/openUrl.mjs"
|
|
18
|
+
|
|
19
|
+
export * from "./utils/lifecycle.mjs"
|
|
20
|
+
|
|
21
|
+
const { isAndroid, isBrowser, isChrome, isChromeExtension, isClient, isExpo, isFirefox, isFirefoxExtension, isGnome, isIframe, isIos, isNative, isNext, isServer, isStorybook, isTauri, isDesktop, isTouchable, isWeb, isWebExtension, isWebTouchable, isWindowDefined } = platform;
|
|
22
|
+
|
|
35
23
|
export { isAndroid, isBrowser, isChrome, isChromeExtension, isClient, isDesktop, isExpo, isFirefox, isFirefoxExtension, isGnome, isIframe, isIos, isNative, isNext, isServer, isStorybook, isTauri, isTouchable, isWeb, isWebExtension, isWebTouchable, isWindowDefined };
|
|
36
24
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/index.js"],"sourcesContent":["import { platform } from \"./platform/index\";\nexport * from \"./platform/index\";\nexport * from \"./helpers\";\nexport * from \"./types\";\nexport * from \"./config/index\";\nexport * from \"./utils/cookie\";\nexport * from \"./utils/downloadFile\";\nexport * from \"./utils/clipboard\";\nexport * from \"./utils/openUrl\";\nexport * from \"./utils/lifecycle\";\nconst {\n isAndroid,\n isBrowser,\n isChrome,\n isChromeExtension,\n isClient,\n isExpo,\n isFirefox,\n isFirefoxExtension,\n isGnome,\n isIframe,\n isIos,\n isNative,\n isNext,\n isServer,\n isStorybook,\n isTauri,\n isDesktop,\n isTouchable,\n isWeb,\n isWebExtension,\n isWebTouchable,\n isWindowDefined\n} = platform;\nexport {\n isAndroid,\n isBrowser,\n isChrome,\n isChromeExtension,\n isClient,\n isDesktop,\n isExpo,\n isFirefox,\n isFirefoxExtension,\n isGnome,\n isIframe,\n isIos,\n isNative,\n isNext,\n isServer,\n isStorybook,\n isTauri,\n isTouchable,\n isWeb,\n isWebExtension,\n isWebTouchable,\n isWindowDefined\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,EACJ,WACA,WACA,UACA,mBACA,UACA,QACA,WACA,oBACA,SACA,UACA,OACA,UACA,QACA,UACA,aACA,SACA,WACA,aACA,OACA,gBACA,gBACA,oBACE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getBroadName, getPreciseName, platformBase } from "./platformBase.native.js";
|
|
2
|
+
|
|
3
|
+
var platform = {
|
|
4
|
+
...platformBase,
|
|
5
|
+
isAndroid: true,
|
|
6
|
+
isExpo: true,
|
|
7
|
+
isNative: true
|
|
8
|
+
};
|
|
9
|
+
platform.preciseName = getPreciseName(platform);
|
|
10
|
+
platform.broadName = getBroadName(platform);
|
|
11
|
+
|
|
12
|
+
export { platform };
|
|
13
|
+
//# sourceMappingURL=index.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.android.js","names":[],"sources":["esm/platform/index.android.js"],"sourcesContent":["import { getBroadName, getPreciseName, platformBase } from \"./platformBase\";\nvar platform = {\n ...platformBase,\n isAndroid: true,\n isExpo: true,\n isNative: true\n};\nplatform.preciseName = getPreciseName(platform);\nplatform.broadName = getBroadName(platform);\nexport {\n platform\n};\n//# sourceMappingURL=index.android.js.map\n"],"mappings":";;;AACA,IAAI,WAAW;CACb,GAAG;CACH,WAAW;CACX,QAAQ;CACR,UAAU;AACZ;AACA,SAAS,cAAc,eAAe,QAAQ;AAC9C,SAAS,YAAY,aAAa,QAAQ"}
|
|
@@ -1,34 +1,29 @@
|
|
|
1
1
|
import { getBroadName, getPreciseName, platformBase } from "./platformBase.mjs";
|
|
2
|
+
|
|
2
3
|
const platform = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// interaction model the layout should assume.
|
|
24
|
-
isTouchable: false,
|
|
25
|
-
isWebTouchable: false,
|
|
26
|
-
// There is a `window` under the react-gnome polyfills, but it is a stub
|
|
27
|
-
// with no layout, no events and no document. Callers branching on this are
|
|
28
|
-
// asking "can I touch the DOM", and the answer is no.
|
|
29
|
-
isWindowDefined: false
|
|
4
|
+
...platformBase,
|
|
5
|
+
isGnome: true,
|
|
6
|
+
isDesktop: true,
|
|
7
|
+
isNative: true,
|
|
8
|
+
isClient: true,
|
|
9
|
+
isServer: false,
|
|
10
|
+
isWeb: false,
|
|
11
|
+
isBrowser: false,
|
|
12
|
+
isChrome: false,
|
|
13
|
+
isFirefox: false,
|
|
14
|
+
isIframe: false,
|
|
15
|
+
isStorybook: false,
|
|
16
|
+
isWebExtension: false,
|
|
17
|
+
isChromeExtension: false,
|
|
18
|
+
isFirefoxExtension: false,
|
|
19
|
+
isExpo: false,
|
|
20
|
+
isNext: false,
|
|
21
|
+
isTouchable: false,
|
|
22
|
+
isWebTouchable: false,
|
|
23
|
+
isWindowDefined: false
|
|
30
24
|
};
|
|
31
25
|
platform.preciseName = getPreciseName(platform);
|
|
32
26
|
platform.broadName = getBroadName(platform);
|
|
27
|
+
|
|
33
28
|
export { platform };
|
|
34
29
|
//# sourceMappingURL=index.gnome.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.gnome.js","names":[],"sources":["esm/platform/index.gnome.js"],"sourcesContent":["import { getBroadName, getPreciseName, platformBase } from \"./platformBase\";\nconst platform = {\n ...platformBase,\n isGnome: true,\n // GTK is a desktop, and it is not a browser — so `isNative` too, which is\n // exactly why Gnome sits ahead of Native in the precision order.\n isDesktop: true,\n isNative: true,\n isClient: true,\n isServer: false,\n isWeb: false,\n isBrowser: false,\n isChrome: false,\n isFirefox: false,\n isIframe: false,\n isStorybook: false,\n isWebExtension: false,\n isChromeExtension: false,\n isFirefoxExtension: false,\n isExpo: false,\n isNext: false,\n // A GTK pointer desktop. Touch exists on some hardware but is not the\n // interaction model the layout should assume.\n isTouchable: false,\n isWebTouchable: false,\n // There is a `window` under the react-gnome polyfills, but it is a stub\n // with no layout, no events and no document. Callers branching on this are\n // asking \"can I touch the DOM\", and the answer is no.\n isWindowDefined: false\n};\nplatform.preciseName = getPreciseName(platform);\nplatform.broadName = getBroadName(platform);\nexport {\n platform\n};\n//# sourceMappingURL=index.gnome.js.map\n"],"mappings":";;;AACA,MAAM,WAAW;CACf,GAAG;CACH,SAAS;CAGT,WAAW;CACX,UAAU;CACV,UAAU;CACV,UAAU;CACV,OAAO;CACP,WAAW;CACX,UAAU;CACV,WAAW;CACX,UAAU;CACV,aAAa;CACb,gBAAgB;CAChB,mBAAmB;CACnB,oBAAoB;CACpB,QAAQ;CACR,QAAQ;CAGR,aAAa;CACb,gBAAgB;CAIhB,iBAAiB;AACnB;AACA,SAAS,cAAc,eAAe,QAAQ;AAC9C,SAAS,YAAY,aAAa,QAAQ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getBroadName, getPreciseName, platformBase } from "./platformBase.native.js";
|
|
2
|
+
|
|
3
|
+
var platform = {
|
|
4
|
+
...platformBase,
|
|
5
|
+
isExpo: true,
|
|
6
|
+
isIos: true,
|
|
7
|
+
isNative: true
|
|
8
|
+
};
|
|
9
|
+
platform.preciseName = getPreciseName(platform);
|
|
10
|
+
platform.broadName = getBroadName(platform);
|
|
11
|
+
|
|
12
|
+
export { platform };
|
|
13
|
+
//# sourceMappingURL=index.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.ios.js","names":[],"sources":["esm/platform/index.ios.js"],"sourcesContent":["import { getBroadName, getPreciseName, platformBase } from \"./platformBase\";\nvar platform = {\n ...platformBase,\n isExpo: true,\n isIos: true,\n isNative: true\n};\nplatform.preciseName = getPreciseName(platform);\nplatform.broadName = getBroadName(platform);\nexport {\n platform\n};\n//# sourceMappingURL=index.ios.js.map\n"],"mappings":";;;AACA,IAAI,WAAW;CACb,GAAG;CACH,QAAQ;CACR,OAAO;CACP,UAAU;AACZ;AACA,SAAS,cAAc,eAAe,QAAQ;AAC9C,SAAS,YAAY,aAAa,QAAQ"}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { getBroadName, getPreciseName, platformBase } from "./platformBase.mjs";
|
|
2
|
+
|
|
2
3
|
const isIframe = (() => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
if (!platformBase.isWindowDefined) return false;
|
|
5
|
+
try {
|
|
6
|
+
return window.self !== window.top;
|
|
7
|
+
} catch {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
9
10
|
})();
|
|
10
11
|
const isWebExtension = !!(typeof chrome !== "undefined" && !!chrome?.runtime?.id || typeof browser !== "undefined" && !!browser?.runtime?.id);
|
|
11
12
|
const platform = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
...platformBase,
|
|
14
|
+
isChromeExtension: typeof chrome !== "undefined" && !!chrome?.runtime?.id,
|
|
15
|
+
isFirefoxExtension: typeof browser !== "undefined" && !!browser?.runtime?.id,
|
|
16
|
+
isIframe,
|
|
17
|
+
isWebExtension,
|
|
18
|
+
isBrowser: !!(platformBase.isWeb && platformBase.isWindowDefined && !isWebExtension),
|
|
19
|
+
isNext: platformBase.isWeb && (!platformBase.isWindowDefined || typeof window.__NEXT_DATA__ === "object"),
|
|
20
|
+
isFirefox: platformBase.isWindowDefined && !!(window?.navigator?.userAgent?.toLowerCase().indexOf("firefox") > -1)
|
|
20
21
|
};
|
|
21
22
|
platform.preciseName = getPreciseName(platform);
|
|
22
23
|
platform.broadName = getBroadName(platform);
|
|
24
|
+
|
|
23
25
|
export { platform };
|
|
24
26
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["esm/platform/index.js"],"sourcesContent":["import { getBroadName, getPreciseName, platformBase } from \"./platformBase\";\nconst isIframe = (() => {\n if (!platformBase.isWindowDefined) return false;\n try {\n return window.self !== window.top;\n } catch {\n return true;\n }\n})();\nconst isWebExtension = !!(typeof chrome !== \"undefined\" && !!chrome?.runtime?.id || typeof browser !== \"undefined\" && !!browser?.runtime?.id);\nconst platform = {\n ...platformBase,\n isChromeExtension: typeof chrome !== \"undefined\" && !!chrome?.runtime?.id,\n isFirefoxExtension: typeof browser !== \"undefined\" && !!browser?.runtime?.id,\n isIframe,\n isWebExtension,\n isBrowser: !!(platformBase.isWeb && platformBase.isWindowDefined && !isWebExtension),\n isNext: platformBase.isWeb && (!platformBase.isWindowDefined || typeof window.__NEXT_DATA__ === \"object\"),\n isFirefox: platformBase.isWindowDefined && !!(window?.navigator?.userAgent?.toLowerCase().indexOf(\"firefox\") > -1)\n};\nplatform.preciseName = getPreciseName(platform);\nplatform.broadName = getBroadName(platform);\nexport {\n platform\n};\n//# sourceMappingURL=index.js.map\n"],"mappings":";;;AACA,MAAM,kBAAkB;CACtB,IAAI,CAAC,aAAa,iBAAiB,OAAO;CAC1C,IAAI;EACF,OAAO,OAAO,SAAS,OAAO;CAChC,QAAQ;EACN,OAAO;CACT;AACF,EAAC,CAAE;AACH,MAAM,iBAAiB,CAAC,EAAE,OAAO,WAAW,eAAe,CAAC,CAAC,QAAQ,SAAS,MAAM,OAAO,YAAY,eAAe,CAAC,CAAC,SAAS,SAAS;AAC1I,MAAM,WAAW;CACf,GAAG;CACH,mBAAmB,OAAO,WAAW,eAAe,CAAC,CAAC,QAAQ,SAAS;CACvE,oBAAoB,OAAO,YAAY,eAAe,CAAC,CAAC,SAAS,SAAS;CAC1E;CACA;CACA,WAAW,CAAC,EAAE,aAAa,SAAS,aAAa,mBAAmB,CAAC;CACrE,QAAQ,aAAa,UAAU,CAAC,aAAa,mBAAmB,OAAO,OAAO,kBAAkB;CAChG,WAAW,aAAa,mBAAmB,CAAC,EAAE,QAAQ,WAAW,WAAW,YAAY,CAAC,CAAC,QAAQ,SAAS,IAAI,CAAC;AAClH;AACA,SAAS,cAAc,eAAe,QAAQ;AAC9C,SAAS,YAAY,aAAa,QAAQ"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { isChrome, isClient, isServer, isWeb, isWebTouchable
|
|
1
|
+
import { isBrowser, isChrome, isClient, isServer, isWeb, isWebTouchable } from "@tamagui/constants";
|
|
2
2
|
import { getBroadName, getPreciseName, platformBase } from "./platformBase.mjs";
|
|
3
|
+
|
|
3
4
|
const isIframe = (() => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
if (!isBrowser) return false;
|
|
6
|
+
try {
|
|
7
|
+
return window.self !== window.top;
|
|
8
|
+
} catch {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
10
11
|
})();
|
|
11
12
|
const platform = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
isTauri: true,
|
|
23
|
-
isDesktop: true
|
|
13
|
+
...platformBase,
|
|
14
|
+
isBrowser: false,
|
|
15
|
+
isChrome,
|
|
16
|
+
isClient,
|
|
17
|
+
isIframe,
|
|
18
|
+
isServer,
|
|
19
|
+
isWeb,
|
|
20
|
+
isWebTouchable,
|
|
21
|
+
isTauri: true,
|
|
22
|
+
isDesktop: true
|
|
24
23
|
};
|
|
25
24
|
platform.preciseName = getPreciseName(platform);
|
|
26
25
|
platform.broadName = getBroadName(platform);
|
|
26
|
+
|
|
27
27
|
export { platform };
|
|
28
28
|
//# sourceMappingURL=index.tauri.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.tauri.js","names":["isWindowDefined"],"sources":["esm/platform/index.tauri.js"],"sourcesContent":["import {\n isBrowser as isWindowDefined,\n isChrome,\n isClient,\n isServer,\n isWeb,\n isWebTouchable\n} from \"@tamagui/constants\";\nimport { getBroadName, getPreciseName, platformBase } from \"./platformBase\";\nconst isIframe = (() => {\n if (!isWindowDefined) return false;\n try {\n return window.self !== window.top;\n } catch {\n return true;\n }\n})();\nconst platform = {\n ...platformBase,\n isBrowser: false,\n isChrome,\n isClient,\n isIframe,\n isServer,\n isWeb,\n isWebTouchable,\n // Tauri-specific flags - using the same interface structure\n // Platform detection: Tauri injects __TAURI_INTERNALS__ at runtime\n isTauri: true,\n isDesktop: true\n};\nplatform.preciseName = getPreciseName(platform);\nplatform.broadName = getBroadName(platform);\nexport {\n platform\n};\n//# sourceMappingURL=index.tauri.js.map\n"],"mappings":";;;;AASA,MAAM,kBAAkB;CACtB,IAAI,CAACA,WAAiB,OAAO;CAC7B,IAAI;EACF,OAAO,OAAO,SAAS,OAAO;CAChC,QAAQ;EACN,OAAO;CACT;AACF,EAAC,CAAE;AACH,MAAM,WAAW;CACf,GAAG;CACH,WAAW;CACX;CACA;CACA;CACA;CACA;CACA;CAGA,SAAS;CACT,WAAW;AACb;AACA,SAAS,cAAc,eAAe,QAAQ;AAC9C,SAAS,YAAY,aAAa,QAAQ"}
|