@g9tm/lynxcontrols 2.5.10 → 2.5.11

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.
@@ -21,8 +21,8 @@ const EN = {
21
21
  preview: 'Preview'
22
22
  };
23
23
  function G9ThemeTokenEditor(props) {
24
- var _props_id, _ref, _theme_name_, _props_language, _props_listHeight, _theme_name_1, _props_language1;
25
- var _props_inherited, _props_words;
24
+ var _props_id, _ref, _theme_name_, _props_language, _theme_name_1, _props_language1, _props_listHeight;
25
+ var _props_inherited, _props_original, _props_words;
26
26
  const w = {
27
27
  ...EN,
28
28
  ...props.words
@@ -50,7 +50,23 @@ function G9ThemeTokenEditor(props) {
50
50
  props.options
51
51
  ]);
52
52
  const own = theme.tokens;
53
+ const saved = null == (_props_original = props.original) ? void 0 : _props_original.tokens;
54
+ const dirty = (name)=>{
55
+ var _own_name, _saved_name;
56
+ return void 0 !== saved && (null != (_own_name = own[name]) ? _own_name : '') !== (null != (_saved_name = saved[name]) ? _saved_name : '');
57
+ };
58
+ const changeCount = saved ? new Set([
59
+ ...Object.keys(own),
60
+ ...Object.keys(saved)
61
+ ]).size - [
62
+ ...new Set([
63
+ ...Object.keys(own),
64
+ ...Object.keys(saved)
65
+ ])
66
+ ].filter((k)=>!dirty(k)).length : Object.keys(own).length;
67
+ const side = 'side' === props.layout || 'stack' !== props.layout && wide;
53
68
  const setToken = (name, value)=>{
69
+ if (props.disabled) return;
54
70
  const next = {
55
71
  ...theme.tokens
56
72
  };
@@ -90,7 +106,7 @@ function G9ThemeTokenEditor(props) {
90
106
  textAlign: rtl ? 'right' : 'left'
91
107
  };
92
108
  const renderItem = (item)=>{
93
- var _ref, _own_name, _resolved_name, _ref1, _inherited_name;
109
+ var _ref, _own_name, _resolved_name, _w_unsaved, _ref1, _inherited_name;
94
110
  var _props_words_groups, _props_words;
95
111
  if ('group' === item.kind) return <text className="g9-token-editor__group" style={align}>
96
112
  {null != (_ref = null == (_props_words = props.words) ? void 0 : null == (_props_words_groups = _props_words.groups) ? void 0 : _props_words_groups[item.id]) ? _ref : item.id}
@@ -104,27 +120,51 @@ function G9ThemeTokenEditor(props) {
104
120
  };
105
121
  const pid = `${base}_${g9SafeId(name)}`;
106
122
  const head = <view className="g9-token-editor__head" style={row}>
123
+ {dirty(name) ? <view className="g9-token-editor__dirty" accessibility-element={true} accessibility-label={null != (_w_unsaved = w.unsaved) ? _w_unsaved : '•'}/> : null}
107
124
  <view className="g9-token-editor__swatch" style={swatch}/>
108
125
  <text className="g9-token-editor__name g9-token-editor__mono" text-maxline="1" style={align}>
109
126
  {name}
110
127
  </text>
111
- {void 0 !== own[name] ? <G9IconButton id={`${pid}_Reset`} icon="close" isGhost buttonSize={32} accessibilityText={w.reset} onPress={()=>setToken(name, null)}/> : null}
128
+ {void 0 !== own[name] && !props.disabled ? <G9IconButton id={`${pid}_Reset`} icon="close" isGhost buttonSize={32} accessibilityText={w.reset} onPress={()=>setToken(name, null)}/> : null}
112
129
  </view>;
113
130
  const field = <view className="g9-token-editor__field">
114
131
  <G9TextEntry id={`${pid}_Value`} value={value} placeholder={null != (_ref1 = null != (_inherited_name = inherited[name]) ? _inherited_name : resolved[name]) ? _ref1 : ''} inputTextDirection="leftToRight" hasError={!valid} {...!valid ? {
115
132
  errorText: w.invalid
116
- } : {}} accessibilityLabel={name} onValueChange={(v)=>setToken(name, v)}/>
133
+ } : {}} accessibilityLabel={name} {...props.disabled ? {
134
+ readOnly: true
135
+ } : {}} onValueChange={(v)=>setToken(name, v)}/>
117
136
  </view>;
118
137
  return <view className={wide ? 'g9-token-editor__row g9-token-editor__row--wide' : 'g9-token-editor__row'} style={wide ? row : {}} {...g9IdProps(pid)}>
119
138
  {head}
120
139
  {field}
121
140
  </view>;
122
141
  };
123
- return <view className="g9-token-editor" {...g9IdProps(props.id)}>
124
- <G9TextEntry id={`${base}_Name`} label={w.name} value={'string' == typeof theme.name ? theme.name : null != (_theme_name_ = theme.name[null != (_props_language = props.language) ? _props_language : 'en']) ? _theme_name_ : ''} maxLength={60} onValueChange={(name)=>props.onChange({
142
+ const previewPart = <>
143
+ <text className="g9-token-editor__group" style={align}>
144
+ {w.preview}
145
+ </text>
146
+ <G9ThemePreviewCard id={`${base}_Preview`} theme={preview} name={'string' == typeof theme.name ? theme.name : null != (_theme_name_ = theme.name[null != (_props_language = props.language) ? _props_language : 'en']) ? _theme_name_ : theme.id}/>
147
+ <G9ContrastPanel id={`${base}_Contrast`} palette={preview.palette} {...preview.appTokens ? {
148
+ appTokens: preview.appTokens
149
+ } : {}} onlyFailures onFix={(token, value)=>{
150
+ var _g9TokenForPalette;
151
+ return setToken(null != (_g9TokenForPalette = g9TokenForPalette(token)) ? _g9TokenForPalette : token, value);
152
+ }} {...(null == (_props_words = props.words) ? void 0 : _props_words.contrast) ? {
153
+ words: props.words.contrast
154
+ } : {}}/>
155
+ </>;
156
+ return <view className={`g9-token-editor${props.fill ? ' g9-token-editor--fill' : ''}${props.disabled ? ' g9-token-editor--disabled' : ''}`} {...g9IdProps(props.id)}>
157
+ <G9TextEntry id={`${base}_Name`} label={w.name} value={'string' == typeof theme.name ? theme.name : null != (_theme_name_1 = theme.name[null != (_props_language1 = props.language) ? _props_language1 : 'en']) ? _theme_name_1 : ''} maxLength={60} {...props.nameError ? {
158
+ errorText: props.nameError,
159
+ hasError: true
160
+ } : {}} {...props.disabled ? {
161
+ readOnly: true
162
+ } : {}} onValueChange={(name)=>{
163
+ if (!props.disabled) props.onChange({
125
164
  ...theme,
126
165
  name
127
- })}/>
166
+ });
167
+ }}/>
128
168
  <view className="g9-token-editor__bar" style={row}>
129
169
  <G9Segmented id={`${base}_Scheme`} size="sm" value={theme.scheme} items={[
130
170
  {
@@ -135,36 +175,31 @@ function G9ThemeTokenEditor(props) {
135
175
  key: 'dark',
136
176
  label: w.dark
137
177
  }
138
- ]} onChange={(s)=>props.onChange({
178
+ ]} onChange={(s)=>{
179
+ if (!props.disabled) props.onChange({
139
180
  ...theme,
140
181
  scheme: s
141
- })}/>
182
+ });
183
+ }}/>
184
+ {w.changes && changeCount > 0 ? <text className="g9-token-editor__count">{w.changes(changeCount)}</text> : null}
142
185
  <view className="g9-token-editor__filter" style={row}>
143
186
  <text className="g9-token-editor__filter-text">{w.changedOnly}</text>
144
187
  <G9Switch id={`${base}_Changed`} checked={changedOnly} accessibilityLabel={w.changedOnly} onCheckedChange={setChangedOnly}/>
145
188
  </view>
146
189
  </view>
147
- <view className="g9-token-editor__list" style={{
190
+ <view className={`g9-token-editor__body${side ? ' g9-token-editor__body--side' : ''}${props.fill ? ' g9-token-editor__body--fill' : ''}`} style={side ? row : {}}>
191
+ <view className={props.fill ? 'g9-token-editor__list g9-token-editor__list--fill' : 'g9-token-editor__list'} style={props.fill ? {} : {
148
192
  height: `${null != (_props_listHeight = props.listHeight) ? _props_listHeight : 480}px`
149
193
  }}>
150
- {false === props.virtual ? <scroll-view className="g9-token-editor__scroll" scroll-orientation="vertical">
151
- {items.map((it)=><view key={'group' === it.kind ? `g:${it.id}` : `t:${it.name}`}>{renderItem(it)}</view>)}
152
- </scroll-view> : <G9VirtualList {...props.id ? {
194
+ {false === props.virtual ? <scroll-view className="g9-token-editor__scroll" scroll-orientation="vertical">
195
+ {items.map((it)=><view key={'group' === it.kind ? `g:${it.id}` : `t:${it.name}`}>{renderItem(it)}</view>)}
196
+ </scroll-view> : <G9VirtualList {...props.id ? {
153
197
  id: `${props.id}_List`
154
198
  } : {}} items={items} getKey={(it)=>'group' === it.kind ? `g:${it.id}` : `t:${it.name}`} estimatedSize={(it)=>'group' === it.kind ? 32 : wide ? 64 : 112} renderItem={renderItem}/>}
199
+ </view>
200
+ {side ? <view className="g9-token-editor__side">{previewPart}</view> : null}
155
201
  </view>
156
- <text className="g9-token-editor__group" style={align}>
157
- {w.preview}
158
- </text>
159
- <G9ThemePreviewCard id={`${base}_Preview`} theme={preview} name={'string' == typeof theme.name ? theme.name : null != (_theme_name_1 = theme.name[null != (_props_language1 = props.language) ? _props_language1 : 'en']) ? _theme_name_1 : theme.id}/>
160
- <G9ContrastPanel id={`${base}_Contrast`} palette={preview.palette} {...preview.appTokens ? {
161
- appTokens: preview.appTokens
162
- } : {}} onlyFailures onFix={(token, value)=>{
163
- var _g9TokenForPalette;
164
- return setToken(null != (_g9TokenForPalette = g9TokenForPalette(token)) ? _g9TokenForPalette : token, value);
165
- }} {...(null == (_props_words = props.words) ? void 0 : _props_words.contrast) ? {
166
- words: props.words.contrast
167
- } : {}}/>
202
+ {side ? null : previewPart}
168
203
  </view>;
169
204
  }
170
205
  export { G9ThemeTokenEditor };
@@ -1,3 +1,3 @@
1
- export { createSwipeGroup, type G9SwipeAction, type G9SwipeGroupStore, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT, } from './model.js';
1
+ export { createSwipeGroup, type G9SwipeAction, type G9SwipeGroupStore, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeFullRatio, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipeFull, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT, } from './model.js';
2
2
  export { G9SwipeGroup, G9SwipeView, type G9SwipeViewProps } from './swipe-view.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/swipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
1
+ export { createSwipeGroup, g9SwipeDefaultActionWidth, g9SwipeDefaultCornerRadius, g9SwipeFullRatio, g9SwipeSnapMs, swipeActionColors, swipeDragTarget, swipeDragTargetMT, swipeFull, swipePaneWidth, swipePhysicalWidths, swipeSnap, swipeSnapMT } from "./model.jsx";
2
2
  export { G9SwipeGroup, G9SwipeView } from "./swipe-view.jsx";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@g9tm/lynxcontrols",
3
- "version": "2.5.10",
3
+ "version": "2.5.11",
4
4
  "description": "ReactLynx controls and overlay infrastructure: provider/host, sheets, popups, toasts, fields, buttons, pickers, tab view, tab bar, edge panel, swipe rows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -234,7 +234,7 @@
234
234
  "build": "rslib build"
235
235
  },
236
236
  "dependencies": {
237
- "@g9tm/lynxcontrols-foundation": "2.5.10"
237
+ "@g9tm/lynxcontrols-foundation": "2.5.11"
238
238
  },
239
239
  "peerDependencies": {
240
240
  "@lynx-js/react": ">=0.129.3 <0.130.0",
@@ -22,7 +22,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
22
22
 
23
23
  ## @g9tm/lynxcontrols-chat
24
24
 
25
- - `@g9tm/lynxcontrols-chat`: G9AckBar, G9ChatComposer, G9ChatThread, G9ConversationRow, G9EditHistorySheet, G9EmojiLibrary, G9EmojiPicker, G9FileCard, G9GifPicker, G9KudosDialog, G9LinkPreview, G9MessageBubble, G9MessageMenu, G9MessageMeta, G9MessageText, G9PersonPicker, G9PinnedBar, G9PollCard, G9PollComposer, G9ReactionBar, G9SchedulePicker, G9SlashSuggestions, G9StickerPicker, G9ThreadSearch, G9TypingDots → `components/chat-1.md`, `components/chat-2.md`, `components/chat-3.md`
25
+ - `@g9tm/lynxcontrols-chat`: G9AckBar, G9ChatComposer, G9ChatThread, G9ConversationRow, G9EditHistorySheet, G9EmojiLibrary, G9EmojiPicker, G9FileCard, G9GifPicker, G9KudosDialog, G9LinkPreview, G9MessageBubble, G9MessageMenu, G9MessageMeta, G9MessageText, G9PersonPicker, G9PinnedBar, G9PollCard, G9PollComposer, G9ReactionBar, G9SchedulePicker, G9SlashSuggestions, G9StickerPicker, G9SystemPill, G9ThreadSearch, G9TypingDots → `components/chat-1.md`, `components/chat-2.md`, `components/chat-3.md`
26
26
 
27
27
  ## @g9tm/lynxcontrols-commerce
28
28
 
@@ -85,7 +85,7 @@ Generated from the installed packages' catalogs (`<package>/catalog`): one line
85
85
 
86
86
  ## @g9tm/lynxcontrols-native
87
87
 
88
- - `@g9tm/lynxcontrols-native/media`: G9TrackVideo → `components/native-media.md`
88
+ - `@g9tm/lynxcontrols-native/media`: G9TrackVideo, G9VideoPlayer → `components/native-media.md`
89
89
 
90
90
  ## @g9tm/lynxcontrols-pilot
91
91
 
@@ -12,9 +12,9 @@ Props:
12
12
  - `systemScheme`: 'light' | 'dark'
13
13
  - `themes`: object[]
14
14
  - `onCreateTheme?`: () => void
15
+ - `onDeleteTheme?`: (theme: G9ThemeDefinition) => void
15
16
  - `onEditTheme?`: (theme: G9ThemeDefinition) => void
16
- - `onExportTheme?`: (theme: G9ThemeDefinition) => void
17
- - `onImportTheme?`: () => void
17
+ - `onExportEach?`: (theme: G9ThemeDefinition) => void
18
18
 
19
19
  Example: `<G9AppearancePage onChange={() => {}} settings={settings} systemScheme="light" themes={themes} />`
20
20
 
@@ -62,12 +62,12 @@ The organisation theme editor: name, scheme, a row per token, a live preview and
62
62
  Props:
63
63
  - `onChange`: (theme: G9TokenTheme) => void
64
64
  - `value`: object
65
+ - `disabled?`: boolean
65
66
  - `listHeight?`: number = 480
67
+ - `fill?`: boolean
66
68
  - `inherited?`: object
67
69
  - `language?`: string
68
- - `options?`: object
69
- - `virtual?`: boolean
70
- - `words?`: object
70
+ - `layout?`: 'auto' | 'side' | 'stack'
71
71
 
72
72
  Example: `<G9ThemeTokenEditor onChange={() => {}} value={value} />`
73
73
 
@@ -138,6 +138,7 @@ Props:
138
138
  - `initial?`: object
139
139
  - `maxOptions?`: number
140
140
  - `minOptions?`: number = 2
141
+ - `now?`: number
141
142
 
142
143
  Example: `<G9PollComposer onSend={() => {}} words={words} />`
143
144
 
@@ -18,6 +18,17 @@ Props:
18
18
 
19
19
  Example: `<G9StickerPicker onPick={() => {}} packs={packs} />`
20
20
 
21
+ # G9SystemPill
22
+
23
+ `import { G9SystemPill } from '@g9tm/lynxcontrols-chat';`
24
+
25
+ A system line in a thread (a member joined, the title changed): a quiet centred pill (2.5.10).
26
+
27
+ Props:
28
+ - `text`: string
29
+
30
+ Example: `<G9SystemPill text="Label" />`
31
+
21
32
  # G9ThreadSearch
22
33
 
23
34
  `import { G9ThreadSearch } from '@g9tm/lynxcontrols-chat';`
@@ -14,3 +14,21 @@ Props:
14
14
  - `mirror?`: boolean
15
15
 
16
16
  Example: `<G9TrackVideo track="track" />`
17
+
18
+ # G9VideoPlayer
19
+
20
+ `import { G9VideoPlayer } from '@g9tm/lynxcontrols-native/media';`
21
+
22
+ A recording with controls (2.5.11, G9Hub 97: video notes, meeting recordings): `<g9-video>` with play / pause, back and forward 10 s, a bar that seeks where it is tapped, the time and mute — the same on Android, iOS and
23
+
24
+ Props:
25
+ - `src`: string
26
+ - `formatTime?`: (seconds: number) => void
27
+ - `onEnded?`: () => void
28
+ - `onError?`: (code: string, message: string) => void
29
+ - `autoPlay?`: boolean = false
30
+ - `fit?`: 'contain' | 'cover'
31
+ - `muted?`: boolean = false
32
+ - `words?`: object
33
+
34
+ Example: `<G9VideoPlayer id="id" src="src" />`
@@ -48,9 +48,9 @@ Props:
48
48
  - `columns?`: number
49
49
  - `formatSize?`: (bytes: number) => void
50
50
  - `menuFor?`: (item: G9FileEntry) => void
51
+ - `onCancelUpload?`: (id: string) => void
51
52
  - `onMenu?`: (key: string, item: G9FileEntry) => void
52
53
  - `onNavigate?`: (folderId: string | null) => void
53
- - `onOpen?`: (item: G9FileEntry) => void
54
54
 
55
55
  Example: `<G9FileBrowser items={items} />`
56
56
 
@@ -66,7 +66,7 @@ Props:
66
66
  - `words`: object
67
67
  - `newId?`: () => void
68
68
  - `rowHeight?`: number = 220
69
- - `kinds?`: 'number' | 'text' | 'date' | 'single' | 'longText' | 'multi' | 'dropdown' | 'rating' | 'scale' | 'file'[]
69
+ - `kinds?`: 'number' | 'text' | 'date' | 'single' | 'longText' | 'multi' | 'dropdown' | 'rating' | 'scale' | 'file' | 'section'[]
70
70
 
71
71
  Example: `<G9FormBuilder onChange={() => {}} questions={questions} words={words} />`
72
72