@controleonline/ui-common 1.2.135 → 1.2.136

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,20 +1,13 @@
1
1
  {
2
- "version": "1.2.135",
2
+ "version": "1.2.136",
3
3
  "rc": 1,
4
- "branch": "rc/1.2.135-rc.1",
5
- "baseMaster": "79a433075b0b62f70eca13f247b3a0696b6315e6",
6
- "baseTag": "v1.2.134",
4
+ "branch": "rc/1.2.136-rc.1",
5
+ "baseMaster": "e9e2c2e18aef6ae9fd7a7b5c81f7abbc4699d412",
7
6
  "tasks": [
8
- 1761
7
+ 168
9
8
  ],
10
- "taskRepository": "ControleOnline/app-community",
11
9
  "frozen": true,
12
10
  "repositories": {
13
- "ControleOnline/ui-common": "7d7d25bb24009dadd7994272dee4f2b4ec59192f"
14
- },
15
- "sources": {
16
- "versão de produção v1.2.134": "df0c24b1d672e11f3165f2da1c1e22737a4e8fa9",
17
- "staging": "18d4fc4da6a487dd66d0f421869c5afea1304ace",
18
- "dev": "e38763d9f79f3a8137a4f10f455cb0daeefdacd8"
11
+ "ControleOnline/ui-common": "8bfec2dc492f477e8a1bfe6cfdb17aa8555d4489"
19
12
  }
20
13
  }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@controleonline/ui-common",
3
- "version": "1.2.135",
3
+ "version": "1.2.136",
4
4
  "author": "ControleOnline",
5
5
  "description": "ControleOnline Common Quasar UI Component",
6
6
  "license": "MIT",
7
7
  "main": "src/react/index.js",
8
8
  "scripts": {
9
- "test": "npm run test:receita-federal && npm run test:imports-status && npm run test:runtime-language && npm run test:runtime-footer && npm run test:runtime-footer-marquee && npm run test:invoice-presentation && npm run test:system-error-message && npm run test:bottom-navigation-toolbar && npm run test:copy-device-configs && npm run test:print-routing && npm run test:device-detail-dependencies && npm run test:runtime-zoom && npm run test:cash-register-summary && npm run test:linked-order-payload && npm run test:document-file-content && npm run test:order-products-summary && npm run test:client-portfolio",
9
+ "test": "npm run test:receita-federal && npm run test:imports-status && npm run test:runtime-language && npm run test:runtime-footer && npm run test:runtime-footer-marquee && npm run test:runtime-footer-platform && npm run test:invoice-presentation && npm run test:system-error-message && npm run test:bottom-navigation-toolbar && npm run test:copy-device-configs && npm run test:print-routing && npm run test:device-detail-dependencies && npm run test:runtime-zoom && npm run test:cash-register-summary && npm run test:linked-order-payload && npm run test:document-file-content && npm run test:order-products-summary && npm run test:client-portfolio",
10
10
  "test:receita-federal": "node --test src/tests/react/pages/receitaFederalIntegrationContract.test.mjs",
11
11
  "test:imports-status": "mkdir -p node_modules/@controleonline && rm -rf node_modules/@controleonline/ui-common && ln -s ../.. node_modules/@controleonline/ui-common && node --test src/tests/react/utils/importStatus.test.js",
12
12
  "test:cash-register-summary": "node --test src/tests/react/utils/cashRegisterSummary.test.js",
@@ -22,6 +22,7 @@
22
22
  "test:bottom-navigation-toolbar": "node --test src/tests/react/utils/bottomNavigationToolbar.test.js",
23
23
  "test:copy-device-configs": "node --test src/tests/react/utils/copyDeviceConfigs.test.mjs",
24
24
  "test:print-routing": "node --test src/tests/react/utils/printRouting.test.mjs src/tests/react/utils/printSpoolUtils.test.mjs",
25
+ "test:runtime-footer-platform": "node --test src/tests/react/components/RuntimeInfoFooter.platform.contract.test.mjs",
25
26
  "test:runtime-footer-marquee": "node --test src/tests/react/components/RuntimeFooterMarqueeText.test.js src/tests/react/components/RuntimeFooterMarqueeText.build.test.js",
26
27
  "test:device-detail-dependencies": "node --test src/tests/react/pages/deviceDetailLoaderDependencies.test.mjs",
27
28
  "test:runtime-zoom": "node --test src/tests/react/utils/runtimeZoom.test.js"
@@ -1,4 +1,4 @@
1
- import React, {useMemo} from 'react';
1
+ import React, {useEffect, useMemo, useState} from 'react';
2
2
  import {
3
3
  ActivityIndicator,
4
4
  Platform,
@@ -25,6 +25,7 @@ import styles from './RuntimeInfoFooter.styles';
25
25
  import RuntimeFooterMarqueeText from './RuntimeFooterMarqueeText';
26
26
  import resolveHomeFooterSpacing from './RuntimeInfoFooter.home.spacing';
27
27
 
28
+ const ROTATION_INTERVAL_MS = 4000;
28
29
  const COMPACT_BREAKPOINT = 720;
29
30
  const MAX_INLINE_TEXT_LENGTH = 84;
30
31
  const FALLBACK_TEXT_COLOR = '#0f172a';
@@ -71,6 +72,7 @@ const RuntimeInfoFooter = ({
71
72
  }) => {
72
73
  const {width} = useWindowDimensions();
73
74
  const insets = useSafeAreaInsets();
75
+ const [activeIndex, setActiveIndex] = useState(0);
74
76
  const allStores = useStores(state => state);
75
77
  const deviceConfigStore = useStore('device_config');
76
78
  const runtimeDebugStore = useStore('runtime_debug');
@@ -137,9 +139,10 @@ const RuntimeInfoFooter = ({
137
139
  }),
138
140
  [companyFooterText, primaryText],
139
141
  );
140
- // Ticker: the text written by the user (company footer) comes first, then the
141
- // system text (e.g. "web • MANAGER (ip) / v1.10.x"). Both scroll together,
142
- // right to left, in a continuous loop (no more alternating between them).
142
+ // Mobile (native): ticker. The text written by the user (company footer) comes
143
+ // first, then the system text (e.g. "Android • MANAGER (ip) / v1.10.x"). Both
144
+ // scroll together, right to left, in a continuous loop.
145
+ // Web: no ticker; the entries alternate every ROTATION_INTERVAL_MS.
143
146
  const inlineText = useMemo(
144
147
  () => getRuntimeFooterTickerText({companyFooterText, primaryText}),
145
148
  [companyFooterText, primaryText],
@@ -215,12 +218,29 @@ const RuntimeInfoFooter = ({
215
218
  ? 0
216
219
  : Math.max(Number(insets.bottom) || 0, 16);
217
220
 
221
+ const isWeb = Platform.OS === 'web';
222
+ const shouldRotate = isWeb && !showDebugInfo && rotationEntries.length > 1;
223
+
224
+ useEffect(() => {
225
+ if (!shouldRotate) {
226
+ setActiveIndex(0);
227
+ return undefined;
228
+ }
229
+
230
+ const intervalId = setInterval(() => {
231
+ setActiveIndex(current => (current + 1) % rotationEntries.length);
232
+ }, ROTATION_INTERVAL_MS);
233
+
234
+ return () => clearInterval(intervalId);
235
+ }, [rotationEntries.length, shouldRotate]);
236
+
218
237
  if (rotationEntries.length === 0 && !showDebugInfo) {
219
238
  return null;
220
239
  }
221
240
 
222
241
  const displayedText =
223
- inlineText || primaryText || formatRuntimeFooterIdentifier(device?.id) || '';
242
+ (shouldRotate ? rotationEntries[activeIndex % rotationEntries.length] : inlineText) ||
243
+ primaryText || formatRuntimeFooterIdentifier(device?.id) || '';
224
244
  const backgroundColor = colors?.footerBackground;
225
245
  const homeSpacing = resolveHomeFooterSpacing(appearance, Platform.OS, insets.bottom);
226
246
  const borderColor = colors?.footerBorder;
@@ -266,7 +286,7 @@ const RuntimeInfoFooter = ({
266
286
  }
267
287
  color={textColor}
268
288
  opacity={1}
269
- continuous
289
+ continuous={!isWeb}
270
290
  style={styles.primaryText}
271
291
  testID="runtime-footer-primary-text"
272
292
  />
@@ -0,0 +1,24 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {readFileSync} from 'node:fs';
4
+
5
+ const source = readFileSync(
6
+ new URL('../../../react/components/RuntimeInfoFooter.js', import.meta.url),
7
+ 'utf8',
8
+ );
9
+
10
+ test('footer rotates every 4s only on web', () => {
11
+ assert.match(source, /ROTATION_INTERVAL_MS = 4000/);
12
+ assert.match(source, /const isWeb = Platform\.OS === 'web'/);
13
+ assert.match(source, /shouldRotate = isWeb && !showDebugInfo && rotationEntries\.length > 1/);
14
+ assert.match(source, /setInterval\([\s\S]*ROTATION_INTERVAL_MS\)/);
15
+ });
16
+
17
+ test('footer is a continuous ticker only on mobile (native)', () => {
18
+ assert.match(source, /continuous=\{!isWeb\}/);
19
+ assert.match(source, /getRuntimeFooterTickerText/);
20
+ });
21
+
22
+ test('footer hooks run before the early return', () => {
23
+ assert.ok(source.indexOf('useEffect(() => {\n if (!shouldRotate)') < source.indexOf('if (rotationEntries.length === 0 && !showDebugInfo)'));
24
+ });