@svadmin/core 0.66.2 → 0.67.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/core",
3
- "version": "0.66.2",
3
+ "version": "0.67.0",
4
4
  "author": "zuohuadong",
5
5
  "repository": {
6
6
  "type": "git",
@@ -513,6 +513,7 @@ const baseLocales: Record<string, Record<string, string>> = {
513
513
  'settings.accent.rose': '玫瑰色',
514
514
  'settings.accent.orange': '橙色',
515
515
  'settings.accent.violet': '紫罗兰色',
516
+ 'settings.accent.arco': '默认',
516
517
  'settings.accent.stripe': '条纹',
517
518
  'settings.language': '语言',
518
519
  'settings.interface': '界面',
@@ -1433,6 +1434,7 @@ const baseLocales: Record<string, Record<string, string>> = {
1433
1434
  'settings.accent.rose': 'Rose',
1434
1435
  'settings.accent.orange': 'Orange',
1435
1436
  'settings.accent.violet': 'Violet',
1437
+ 'settings.accent.arco': 'Default',
1436
1438
  'settings.accent.stripe': 'Stripe',
1437
1439
  'settings.language': 'Language',
1438
1440
  'settings.interface': 'Interface',
package/src/plain-data.ts CHANGED
@@ -5,7 +5,7 @@ export function snapshotPlainData(value: unknown): JsonValue {
5
5
  function snapshot(value: unknown, ancestors: Set<object>): JsonValue {
6
6
  if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;
7
7
  if (typeof value === 'number' && Number.isFinite(value)) return value;
8
- if (typeof value !== 'object' || value === null || ancestors.has(value)) {
8
+ if (typeof value !== 'object' || ancestors.has(value)) {
9
9
  throw new TypeError('Invalid plain data');
10
10
  }
11
11
  const array = Array.isArray(value);
@@ -22,7 +22,7 @@ function copySchemaData(value: unknown, ancestors = new Set<object>(), depth = 0
22
22
  if (depth > 128) return invalidSchema();
23
23
  if (value === null || value === undefined || typeof value === 'string' || typeof value === 'boolean') return value;
24
24
  if (typeof value === 'number' && Number.isFinite(value)) return value;
25
- if (typeof value !== 'object' || value === null || ancestors.has(value)) return invalidSchema();
25
+ if (typeof value !== 'object' || ancestors.has(value)) return invalidSchema();
26
26
  const array = Array.isArray(value);
27
27
  const prototype: unknown = Object.getPrototypeOf(value);
28
28
  if (!array && prototype !== Object.prototype && prototype !== null) return invalidSchema();
@@ -107,7 +107,7 @@ export function createTableQuery<TQueryFnData extends BaseRecord>(
107
107
  const merged=[...currentFilters];
108
108
  for(const nf of newFilters) {
109
109
  if(!('field' in nf)) { merged.push(nf); continue; }
110
- const idx=merged.findIndex(f => 'field' in f&&f.field===nf.field&&f.operator===nf.operator);
110
+ const idx = merged.findIndex(f => 'field' in f && f.field === nf.field && f.operator === nf.operator);
111
111
  if(idx>=0) {
112
112
  if(nf.value===undefined||nf.value===null||nf.value==='') merged.splice(idx,1);
113
113
  else merged[idx]=nf;
@@ -217,7 +217,7 @@ export function createTableQuery<TQueryFnData extends BaseRecord>(
217
217
 
218
218
  let cmp: number;
219
219
  if(typeof va==='number'&&typeof vb==='number') cmp=va-vb;
220
- else if(va instanceof Date&&vb instanceof Date) cmp=va.getTime()-vb.getTime();
220
+ else if (va instanceof Date && vb instanceof Date) cmp = va.getTime() - vb.getTime();
221
221
  else if(typeof va==='string'&&typeof vb==='string'&&!isNaN(Number(va))&&!isNaN(Number(vb))) cmp=Number(va)-Number(vb);
222
222
  else cmp=String(va).localeCompare(String(vb));
223
223
 
@@ -207,7 +207,7 @@ export class TableState {
207
207
  const merged=[...this.currentFilters];
208
208
  for(const nf of newFilters) {
209
209
  if(!('field' in nf)) { merged.push(nf); continue; }
210
- const idx=merged.findIndex(f => 'field' in f&&f.field===nf.field&&f.operator===nf.operator);
210
+ const idx = merged.findIndex(f => 'field' in f && f.field === nf.field && f.operator === nf.operator);
211
211
  if(idx>=0) {
212
212
  if(nf.value===undefined||nf.value===null||nf.value==='') merged.splice(idx,1);
213
213
  else merged[idx]=nf;
@@ -6,7 +6,7 @@ import { definedOptions } from './defined-options';
6
6
  // - 'dark-first': adds 'light' class for light mode (dark-first)
7
7
 
8
8
  export type ThemeMode='light'|'dark'|'system';
9
- export type ColorTheme='blue'|'green'|'rose'|'orange'|'violet'|'neutral'|'indigo'|'stripe';
9
+ export type ColorTheme='arco'|'blue'|'green'|'rose'|'orange'|'violet'|'neutral'|'indigo'|'stripe';
10
10
 
11
11
  /** Controls how the theme class is applied to <html> */
12
12
  export type ThemeStrategy='standard'|'dark-first';
@@ -190,6 +190,29 @@ export const builtinPresets: Record<string,ColorPreset>=$state({
190
190
  '--chart-1': 'oklch(0.65 0.25 293)',
191
191
  },
192
192
  },
193
+ arco: {
194
+ name: 'arco',
195
+ label: 'Default',
196
+ color: '#165DFF',
197
+ light: {
198
+ '--primary': '#165DFF',
199
+ '--primary-foreground': '#FFFFFF',
200
+ '--ring': '#165DFF',
201
+ '--sidebar-primary': '#165DFF',
202
+ '--sidebar-primary-foreground': '#FFFFFF',
203
+ '--sidebar-ring': '#165DFF',
204
+ '--chart-1': '#165DFF',
205
+ },
206
+ dark: {
207
+ '--primary': '#3C7EFF',
208
+ '--primary-foreground': '#FFFFFF',
209
+ '--ring': '#3C7EFF',
210
+ '--sidebar-primary': '#3C7EFF',
211
+ '--sidebar-primary-foreground': '#FFFFFF',
212
+ '--sidebar-ring': '#3C7EFF',
213
+ '--chart-1': '#3C7EFF',
214
+ },
215
+ },
193
216
  stripe: {
194
217
  name: 'stripe',
195
218
  label: 'Stripe',
@@ -325,8 +348,8 @@ function readStoredTheme(): ThemeMode|undefined {
325
348
 
326
349
  function readStoredColorTheme(): ColorTheme {
327
350
  const stored=getStorage()?.getItem(COLOR_STORAGE_KEY);
328
- // Stripe is the product default; an existing persisted preset remains authoritative.
329
- return stored&&builtinPresets[stored]? stored as ColorTheme:'stripe';
351
+ // The built-in preset is the product default; an existing persisted preset remains authoritative.
352
+ return stored&&builtinPresets[stored]? stored as ColorTheme:'arco';
330
353
  }
331
354
 
332
355
  function persistSelection(key: string,value: string): void {