@gjsify/adwaita-app 0.64.1-next.241 → 0.64.1-next.243
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/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{appdataLocale as e,parseAppdata as t}from"./appdata.js";import{applyAppdataFields as n,buildAboutDialogFromAppdata as r,createAboutDialog as i,hasAppdataConstructor as a,licenseTypeFor as o}from"./about-dialog.js";import{BUNDLED_ICON_COUNT as s,BUNDLED_ICON_RESOURCE_PATH as c}from"./icons.generated.js";import{BUNDLED_ICON_THEME_NAME as l,addBundledIconsToTheme as u,installBundledIconTheme as d,registerBundledIconResource as f}from"./icon-theme.js";import{AdwaitaApp as p,runAdwaitaApp as m,runApplication as h}from"./application.js";import{readAppDevHooks as g}from"./dev-hooks.js";import{confirmDialog as _,errorDialog as v}from"./dialogs.js";import{pickFile as y,saveFile as b}from"./file-dialog.js";import{createNavShell as x}from"./nav-shell.js";import{LoadToken as S,loadIntoStack as C}from"./view-loader.js";import{LoadingStack as w}from"./loading-stack.js";import{registerToastOverlay as T,showToast as E}from"./toast.js";import{SYSTEM_LOCALE_DIR as D,resolveLocaleDir as O,systemLocaleDir as k}from"./locale-dir.js";import{
|
|
1
|
+
import{appdataLocale as e,parseAppdata as t}from"./appdata.js";import{applyAppdataFields as n,buildAboutDialogFromAppdata as r,createAboutDialog as i,hasAppdataConstructor as a,licenseTypeFor as o}from"./about-dialog.js";import{BUNDLED_ICON_COUNT as s,BUNDLED_ICON_RESOURCE_PATH as c}from"./icons.generated.js";import{BUNDLED_ICON_THEME_NAME as l,addBundledIconsToTheme as u,installBundledIconTheme as d,registerBundledIconResource as f}from"./icon-theme.js";import{AdwaitaApp as p,runAdwaitaApp as m,runApplication as h}from"./application.js";import{readAppDevHooks as g}from"./dev-hooks.js";import{confirmDialog as _,errorDialog as v}from"./dialogs.js";import{pickFile as y,saveFile as b}from"./file-dialog.js";import{createNavShell as x}from"./nav-shell.js";import{LoadToken as S,loadIntoStack as C}from"./view-loader.js";import{LoadingStack as w}from"./loading-stack.js";import{registerToastOverlay as T,showToast as E}from"./toast.js";import{SYSTEM_LOCALE_DIR as D,resolveLocaleDir as O,systemLocaleDir as k}from"./locale-dir.js";import{LOCALE_ENV_VARS as A,localeEnvToSet as j,posixLocale as M}from"./locale-env.js";import{initLocale as N}from"./locale.js";import{APPLE_ACCENT_COLOR_ARGV as P,MACOS_ACCENT_POLL_SECONDS as F,onMacosAccentColorChanged as I,readMacosAccentColor as L}from"./system-accent.js";import{findNavItem as R,resolveInitialNavIndex as z}from"./nav-model.js";export{P as APPLE_ACCENT_COLOR_ARGV,p as AdwaitaApp,s as BUNDLED_ICON_COUNT,c as BUNDLED_ICON_RESOURCE_PATH,l as BUNDLED_ICON_THEME_NAME,A as LOCALE_ENV_VARS,S as LoadToken,w as LoadingStack,F as MACOS_ACCENT_POLL_SECONDS,D as SYSTEM_LOCALE_DIR,u as addBundledIconsToTheme,e as appdataLocale,n as applyAppdataFields,r as buildAboutDialogFromAppdata,_ as confirmDialog,i as createAboutDialog,x as createNavShell,v as errorDialog,R as findNavItem,a as hasAppdataConstructor,N as initLocale,d as installBundledIconTheme,o as licenseTypeFor,C as loadIntoStack,j as localeEnvToSet,I as onMacosAccentColorChanged,t as parseAppdata,y as pickFile,M as posixLocale,g as readAppDevHooks,L as readMacosAccentColor,f as registerBundledIconResource,T as registerToastOverlay,z as resolveInitialNavIndex,O as resolveLocaleDir,m as runAdwaitaApp,h as runApplication,b as saveFile,E as showToast,k as systemLocaleDir};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=[`LANGUAGE`,`LC_ALL`,`LC_MESSAGES`,`LANG`];function posixLocale(e){if(e===void 0)return;let[t,...n]=e.trim().split(/[.@]/)[0].split(/-u-|-x-/i)[0].split(/[-_]/);if(!/^[A-Za-z]{2,3}$/.test(t??``)||/^(c|posix)$/i.test(t))return;let r=n.find(e=>/^[A-Za-z]{2}$/.test(e));return r===void 0?t.toLowerCase():`${t.toLowerCase()}_${r.toUpperCase()}`}function localeEnvToSet(t){if(t.platform===`win32`&&!e.some(e=>(t.env[e]??``).trim()!==``))for(let e of t.userLocales){let t=posixLocale(e);if(t!==void 0)return t}}export{e as LOCALE_ENV_VARS,localeEnvToSet,posixLocale};
|
package/lib/esm/locale.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{resolveLocaleDir as e}from"./locale-dir.js";import t from"gi://GLib?version=2.0";import
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{resolveLocaleDir as e}from"./locale-dir.js";import{LOCALE_ENV_VARS as t,localeEnvToSet as n}from"./locale-env.js";import r from"gi://GLib?version=2.0";import i from"gettext";function adoptUserLocaleOnWindows(e){if(e!==`win32`)return;let i={};for(let e of t)i[e]=r.getenv(e)??process.env[e];let a=n({platform:e,env:i,userLocales:[typeof Intl>`u`?void 0:Intl.DateTimeFormat().resolvedOptions().locale,r.get_language_names()[0]]});a!==void 0&&(r.setenv(`LANG`,a,!1),process.env.LANG=a)}function initLocale(t,n={}){let a=typeof process>`u`?void 0:process.platform,o=e({...n,env:{GJSIFY_LOCALE_DIR:r.getenv(`GJSIFY_LOCALE_DIR`)??void 0},platform:a});return adoptUserLocaleOnWindows(a),i.setlocale(i.LocaleCategory.ALL,``),o!==void 0&&i.bindtextdomain(t,o),i.textdomain(t),Object.assign(e=>i.dgettext(t,e),{plural:(e,n,r)=>i.dngettext(t,e,n,r),context:(e,n)=>i.dpgettext(t,e,n),localeDir:o,domain:t})}export{initLocale};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { initLocale } from './locale.js';
|
|
|
20
20
|
export type { InitLocaleOptions, Translator } from './locale.js';
|
|
21
21
|
export { SYSTEM_LOCALE_DIR, resolveLocaleDir, systemLocaleDir } from './locale-dir.js';
|
|
22
22
|
export type { ResolveLocaleDirOptions } from './locale-dir.js';
|
|
23
|
+
export { LOCALE_ENV_VARS, localeEnvToSet, posixLocale } from './locale-env.js';
|
|
24
|
+
export type { LocaleEnvOptions } from './locale-env.js';
|
|
23
25
|
export { APPLE_ACCENT_COLOR_ARGV, MACOS_ACCENT_POLL_SECONDS, onMacosAccentColorChanged, readMacosAccentColor, } from './system-accent.js';
|
|
24
26
|
export type { OnMacosAccentColorChangedOptions, ReadMacosAccentColorOptions } from './system-accent.js';
|
|
25
27
|
export { readAppDevHooks } from './dev-hooks.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The variables gettext consults, in its own precedence order. */
|
|
2
|
+
export declare const LOCALE_ENV_VARS: readonly string[];
|
|
3
|
+
/**
|
|
4
|
+
* A BCP 47 tag (`de-DE`, `zh-Hans-CN`) or a POSIX locale (`de_DE.UTF-8`) as `ll[_CC]`, or
|
|
5
|
+
* `undefined` for "C"/"POSIX"/garbage — a value that must not be written into `LANG`.
|
|
6
|
+
*
|
|
7
|
+
* The script subtag and any extension (`-u-ca-…`) are dropped: gettext catalogues are named
|
|
8
|
+
* `ll_CC`, so `zh-Hant-TW` must become `zh_TW`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function posixLocale(tag: string | undefined): string | undefined;
|
|
11
|
+
export interface LocaleEnvOptions {
|
|
12
|
+
/** `process.platform`. Anything but `win32` answers `undefined`. */
|
|
13
|
+
platform?: string;
|
|
14
|
+
/** The current values of {@link LOCALE_ENV_VARS}. */
|
|
15
|
+
env: Record<string, string | undefined>;
|
|
16
|
+
/** The user's locale, best source first — a BCP 47 tag or a POSIX name. */
|
|
17
|
+
userLocales: readonly (string | undefined)[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The value to export as `LANG`, or `undefined` for "leave the environment alone".
|
|
21
|
+
*
|
|
22
|
+
* Only on win32, and only when all four variables are unset or empty: a user who set any of
|
|
23
|
+
* them chose a locale, and this must never override it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function localeEnvToSet(options: LocaleEnvOptions): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/adwaita-app",
|
|
3
|
-
"version": "0.64.1-next.
|
|
3
|
+
"version": "0.64.1-next.243",
|
|
4
4
|
"description": "Native Adwaita application shell for GJS/GTK apps — Adw.Application lifecycle (runAsync + devtools + CSS), a data-driven NavigationSplitView nav shell, an async-view mounter, promise dialog/toast/file helpers, and a display-less reader of the desktop accent and colour scheme (`./appearance`)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"@girs/glib-2.0": "5.4.0",
|
|
58
58
|
"@girs/gobject-2.0": "5.4.0",
|
|
59
59
|
"@girs/gtk-4.0": "5.4.0",
|
|
60
|
-
"@gjsify/adwaita-core": "0.64.1-next.
|
|
61
|
-
"@gjsify/devtools": "0.64.1-next.
|
|
60
|
+
"@gjsify/adwaita-core": "0.64.1-next.243",
|
|
61
|
+
"@gjsify/devtools": "0.64.1-next.243"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@gjsify/cli": "0.64.1-next.
|
|
65
|
-
"@gjsify/storybook": "0.64.1-next.
|
|
66
|
-
"@gjsify/unit": "0.64.1-next.
|
|
64
|
+
"@gjsify/cli": "0.64.1-next.243",
|
|
65
|
+
"@gjsify/storybook": "0.64.1-next.243",
|
|
66
|
+
"@gjsify/unit": "0.64.1-next.243",
|
|
67
67
|
"@types/node": "^25.9.2",
|
|
68
68
|
"typescript": "^6.0.3"
|
|
69
69
|
},
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"url": "https://github.com/gjsify/gjsify/issues"
|
|
102
102
|
},
|
|
103
103
|
"homepage": "https://github.com/gjsify/gjsify/tree/main/packages/framework/adwaita-app#readme",
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "f88c7b1074d454e211094963a9f4dc7d0982bf32"
|
|
105
105
|
}
|