@globalbrain/sefirot 4.4.1 → 4.5.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/config/vite.js CHANGED
@@ -12,6 +12,7 @@
12
12
  */
13
13
 
14
14
  import { fileURLToPath } from 'node:url'
15
+ import MagicString from 'magic-string'
15
16
  import icons from 'unplugin-icons/vite'
16
17
  import { mergeConfig } from 'vite'
17
18
 
@@ -23,18 +24,27 @@ export const baseConfig = {
23
24
  enforce: 'pre',
24
25
  name: 'sefirot:patch-linkify-it',
25
26
  transform(code, id) {
26
- if (id.includes('markdown-it')) {
27
- return code.replace(
28
- 'const text_separators = "[><\uFF5C]"',
29
- 'const text_separators = "[><\uFF00-\uFFEF]"' // https://www.fileformat.info/info/unicode/block/halfwidth_and_fullwidth_forms/index.htm
30
- )
27
+ if (id.includes('linkify-it/lib/re.mjs')) {
28
+ const s = new MagicString(code)
29
+
30
+ const search = 'const text_separators = \'[><\\uff5c]\''
31
+ const replace = 'const text_separators = \'[><\\uff00-\\uffef]\''
32
+
33
+ const index = code.indexOf(search)
34
+ if (index !== -1) {
35
+ s.overwrite(index, index + search.length, replace)
36
+ }
37
+
38
+ return { code: s.toString(), map: s.generateMap({ source: id }) }
31
39
  }
32
40
  }
33
41
  }
34
42
  ],
35
43
 
36
44
  resolve: {
37
- alias: { 'sefirot/': fileURLToPath(new URL('../lib/', import.meta.url)) },
45
+ alias: {
46
+ 'sefirot/': fileURLToPath(new URL('../lib/', import.meta.url))
47
+ },
38
48
 
39
49
  dedupe: [
40
50
  '@sentry/browser',
@@ -69,6 +79,10 @@ export const baseConfig = {
69
79
  'dayjs/plugin/relativeTime',
70
80
  'dayjs/plugin/timezone',
71
81
  'dayjs/plugin/utc',
82
+ 'markdown-it > argparse',
83
+ 'markdown-it > entities'
84
+ ],
85
+ exclude: [
72
86
  'markdown-it'
73
87
  ]
74
88
  }
@@ -55,14 +55,14 @@ withDefaults(defineProps<{
55
55
  gap: 16px;
56
56
  }
57
57
 
58
- .content :slotted(p) {
58
+ .content :deep(p) {
59
59
  margin: 0;
60
60
  max-width: 65ch;
61
61
  line-height: 24px;
62
62
  font-size: 14px;
63
63
  }
64
64
 
65
- .content :slotted(a) {
65
+ .content :deep(a) {
66
66
  font-weight: 500;
67
67
  text-decoration: underline;
68
68
  transition: color 0.25s;
package/lib/http/Http.ts CHANGED
@@ -1,13 +1,7 @@
1
1
  import { parse as parseContentDisposition } from '@tinyhttp/content-disposition'
2
2
  import { parse as parseCookie } from '@tinyhttp/cookie'
3
3
  import FileSaver from 'file-saver'
4
- import {
5
- FetchError,
6
- type FetchOptions,
7
- type FetchRequest,
8
- type FetchResponse,
9
- ofetch
10
- } from 'ofetch'
4
+ import { FetchError, type FetchOptions, type FetchRequest, type FetchResponse, ofetch } from 'ofetch'
11
5
  import { stringify } from 'qs'
12
6
  import { type Lang } from '../composables/Lang'
13
7
  import { isBlob, isError, isFormData, isRequest, isResponse, isString } from '../support/Utils'
@@ -15,8 +9,8 @@ import { isBlob, isError, isFormData, isRequest, isResponse, isString } from '..
15
9
  type Awaitable<T> = T | PromiseLike<T>
16
10
 
17
11
  export interface HttpClient {
18
- <T = any>(request: FetchRequest, options?: Omit<FetchOptions, 'method'>): Promise<T>
19
- raw<T = any>(request: FetchRequest, options?: Omit<FetchOptions, 'method'>): Promise<FetchResponse<T>>
12
+ (request: FetchRequest, options?: Omit<FetchOptions, 'method'>): Promise<any>
13
+ raw(request: FetchRequest, options?: Omit<FetchOptions, 'method'>): Promise<FetchResponse<any>>
20
14
  }
21
15
 
22
16
  export interface HttpOptions {
@@ -36,7 +30,7 @@ export class Http {
36
30
  private static payloadKey = '__payload__'
37
31
  private static headers: () => Awaitable<Record<string, string>> = async () => ({})
38
32
 
39
- static config(options: HttpOptions) {
33
+ static config(options: HttpOptions): void {
40
34
  if (options.baseUrl) {
41
35
  Http.baseUrl = options.baseUrl
42
36
  }
@@ -72,15 +66,9 @@ export class Http {
72
66
  return xsrfToken
73
67
  }
74
68
 
75
- private async buildRequest(
76
- url: string,
77
- _options: FetchOptions = {}
78
- ): Promise<[string, FetchOptions]> {
69
+ private async buildRequest(url: string, _options: FetchOptions = {}): Promise<[string, FetchOptions]> {
79
70
  const { method, params, query, ...options } = _options
80
-
81
- const xsrfToken
82
- = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method || '') && (await this.ensureXsrfToken())
83
-
71
+ const xsrfToken = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(method || '') && (await this.ensureXsrfToken())
84
72
  const queryString = stringify({ ...params, ...query }, { encodeValuesOnly: true })
85
73
 
86
74
  return [
@@ -101,12 +89,12 @@ export class Http {
101
89
  ]
102
90
  }
103
91
 
104
- private async performRequest<T>(url: string, options: FetchOptions = {}) {
105
- return Http.client<T>(...(await this.buildRequest(url, options)))
92
+ private async performRequest<T>(url: string, options: FetchOptions = {}): Promise<T> {
93
+ return Http.client(...(await this.buildRequest(url, options)))
106
94
  }
107
95
 
108
- private async performRequestRaw<T>(url: string, options: FetchOptions = {}) {
109
- return Http.client.raw<T>(...(await this.buildRequest(url, options)))
96
+ private async performRequestRaw<T>(url: string, options: FetchOptions = {}): Promise<FetchResponse<T>> {
97
+ return Http.client.raw(...(await this.buildRequest(url, options)))
110
98
  }
111
99
 
112
100
  async get<T = any>(url: string, options?: FetchOptions): Promise<T> {
@@ -174,7 +162,7 @@ export class Http {
174
162
  FileSaver.saveAs(blob, filename as string)
175
163
  }
176
164
 
177
- private objectToFormData(obj: any, form?: FormData, namespace?: string, onlyFiles = false) {
165
+ private objectToFormData(obj: any, form?: FormData, namespace?: string, onlyFiles = false): FormData {
178
166
  const fd = form || new FormData()
179
167
  let formKey: string
180
168
 
@@ -211,9 +199,11 @@ export function isFetchError(e: unknown): e is FetchError {
211
199
  && (isString((e as FetchError).request) || isRequest((e as FetchError).request))
212
200
  && ((e as FetchError).response === undefined || isResponse((e as FetchError).response))
213
201
  && e.message.startsWith(
214
- `[${((e as FetchError).request as Request | undefined)?.method || (e as FetchError).options?.method || 'GET'}] ${
215
- JSON.stringify(((e as FetchError).request as Request | undefined)?.url || String((e as FetchError).request) || '/')
216
- }: `
202
+ `[${
203
+ ((e as FetchError).request as Request | undefined)?.method || (e as FetchError).options?.method || 'GET'
204
+ }] ${JSON.stringify(
205
+ ((e as FetchError).request as Request | undefined)?.url || String((e as FetchError).request) || '/'
206
+ )}: `
217
207
  ))
218
208
  )
219
209
  }
@@ -14,6 +14,9 @@ body {
14
14
  font-weight: 400;
15
15
  color: var(--c-text-1);
16
16
  background-color: var(--c-bg-elv-1);
17
+ font-synthesis: none;
18
+ -webkit-font-smoothing: antialiased;
19
+ -moz-osx-font-smoothing: grayscale;
17
20
  }
18
21
 
19
22
  blockquote,
@@ -507,9 +507,9 @@
507
507
  --button-fill-info-active-border-color: var(--c-border-info-3);
508
508
  --button-fill-info-active-text-color: var(--c-white-1);
509
509
  --button-fill-info-active-bg-color: var(--c-bg-info-3);
510
- --button-fill-info-disabled-border-color: var(--c-border-info-1);
511
- --button-fill-info-disabled-text-color: var(--c-white-a3);
512
- --button-fill-info-disabled-content-color: var(--c-white-a3);
510
+ --button-fill-info-disabled-border-color: var(--c-blue-9);
511
+ --button-fill-info-disabled-text-color: var(--c-white-a2);
512
+ --button-fill-info-disabled-content-color: var(--c-white-a2);
513
513
  --button-fill-info-disabled-bg-color: var(--c-blue-8);
514
514
 
515
515
  --button-fill-success-border-color: var(--c-border-success-1);
@@ -523,9 +523,9 @@
523
523
  --button-fill-success-active-border-color: var(--c-border-success-3);
524
524
  --button-fill-success-active-text-color: var(--c-white);
525
525
  --button-fill-success-active-bg-color: var(--c-bg-success-3);
526
- --button-fill-success-disabled-border-color: var(--c-border-success-1);
527
- --button-fill-success-disabled-text-color: var(--c-white-a3);
528
- --button-fill-success-disabled-content-color: var(--c-white-a3);
526
+ --button-fill-success-disabled-border-color: var(--c-green-9);
527
+ --button-fill-success-disabled-text-color: var(--c-white-a2);
528
+ --button-fill-success-disabled-content-color: var(--c-white-a2);
529
529
  --button-fill-success-disabled-bg-color: var(--c-green-8);
530
530
 
531
531
  --button-fill-warning-border-color: var(--c-border-mute-1);
@@ -540,8 +540,8 @@
540
540
  --button-fill-warning-active-text-color: var(--c-white);
541
541
  --button-fill-warning-active-bg-color: var(--c-bg-warning-2);
542
542
  --button-fill-warning-disabled-border-color: var(--c-border-mute-1);
543
- --button-fill-warning-disabled-text-color: var(--c-text-warning-3);
544
- --button-fill-warning-disabled-content-color: var(--c-text-warning-3);
543
+ --button-fill-warning-disabled-text-color: var(--c-text-warning-2);
544
+ --button-fill-warning-disabled-content-color: var(--c-text-warning-2);
545
545
  --button-fill-warning-disabled-bg-color: var(--c-bg-mute-1);
546
546
 
547
547
  --button-fill-danger-border-color: var(--c-border-mute-1);
@@ -556,8 +556,8 @@
556
556
  --button-fill-danger-active-text-color: var(--c-white);
557
557
  --button-fill-danger-active-bg-color: var(--c-bg-danger-2);
558
558
  --button-fill-danger-disabled-border-color: var(--c-border-mute-1);
559
- --button-fill-danger-disabled-text-color: var(--c-text-danger-3);
560
- --button-fill-danger-disabled-content-color: var(--c-text-danger-3);
559
+ --button-fill-danger-disabled-text-color: var(--c-text-danger-2);
560
+ --button-fill-danger-disabled-content-color: var(--c-text-danger-2);
561
561
  --button-fill-danger-disabled-bg-color: var(--c-bg-mute-1);
562
562
 
563
563
  --button-outline-default-border-color: var(--c-border-mute-1);
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
3
  "type": "module",
4
- "version": "4.4.1",
5
- "packageManager": "pnpm@9.9.0",
4
+ "version": "4.5.0",
5
+ "packageManager": "pnpm@9.12.1",
6
6
  "description": "Vue Components for Global Brain Design System.",
7
7
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",
8
8
  "license": "MIT",
@@ -48,52 +48,53 @@
48
48
  "@types/body-scroll-lock": "^3.1.2",
49
49
  "@types/lodash-es": "^4.17.12",
50
50
  "@types/markdown-it": "^14.1.2",
51
- "@vue/reactivity": "^3.5.1",
51
+ "@vue/reactivity": "^3.5.11",
52
52
  "@vuelidate/core": "^2.0.3",
53
53
  "@vuelidate/validators": "^2.0.4",
54
- "@vueuse/core": "^11.0.3",
54
+ "@vueuse/core": "^11.1.0",
55
55
  "body-scroll-lock": "4.0.0-beta.0",
56
56
  "dayjs": "^1.11.13",
57
57
  "fuse.js": "^7.0.0",
58
58
  "lodash-es": "^4.17.21",
59
59
  "markdown-it": "^14.1.0",
60
60
  "normalize.css": "^8.0.1",
61
- "pinia": "^2.2.2",
62
- "postcss": "^8.4.45",
61
+ "pinia": "^2.2.4",
62
+ "postcss": "^8.4.47",
63
63
  "postcss-nested": "^6.2.0",
64
64
  "v-calendar": "3.0.1",
65
- "vue": "^3.5.1",
66
- "vue-router": "^4.4.3"
65
+ "vue": "^3.5.11",
66
+ "vue-router": "^4.4.5"
67
67
  },
68
68
  "dependencies": {
69
- "@sentry/browser": "^8.28.0",
69
+ "@sentry/browser": "^8.33.1",
70
70
  "@tanstack/vue-virtual": "3.0.0-beta.62",
71
- "@tinyhttp/content-disposition": "^2.2.1",
71
+ "@tinyhttp/content-disposition": "^2.2.2",
72
72
  "@tinyhttp/cookie": "^2.1.1",
73
73
  "@types/file-saver": "^2.0.7",
74
- "@types/qs": "^6.9.15",
74
+ "@types/qs": "^6.9.16",
75
75
  "file-saver": "^2.0.5",
76
- "ofetch": "^1.3.4",
76
+ "magic-string": "^0.30.11",
77
+ "ofetch": "^1.4.0",
77
78
  "qs": "^6.13.0",
78
- "unplugin-icons": "^0.19.2"
79
+ "unplugin-icons": "^0.19.3"
79
80
  },
80
81
  "devDependencies": {
81
82
  "@globalbrain/eslint-config": "^1.7.1",
82
83
  "@histoire/plugin-vue": "0.16.5",
83
84
  "@iconify-json/ph": "^1.2.0",
84
85
  "@iconify-json/ri": "^1.2.0",
85
- "@release-it/conventional-changelog": "^8.0.1",
86
+ "@release-it/conventional-changelog": "^8.0.2",
86
87
  "@types/body-scroll-lock": "^3.1.2",
87
88
  "@types/lodash-es": "^4.17.12",
88
89
  "@types/markdown-it": "^14.1.2",
89
- "@types/node": "^22.5.3",
90
- "@vitejs/plugin-vue": "^5.1.3",
91
- "@vitest/coverage-v8": "^2.0.5",
92
- "@vue/reactivity": "^3.5.1",
90
+ "@types/node": "^22.7.5",
91
+ "@vitejs/plugin-vue": "^5.1.4",
92
+ "@vitest/coverage-v8": "^2.1.2",
93
+ "@vue/reactivity": "^3.5.11",
93
94
  "@vue/test-utils": "^2.4.6",
94
95
  "@vuelidate/core": "^2.0.3",
95
96
  "@vuelidate/validators": "^2.0.4",
96
- "@vueuse/core": "^11.0.3",
97
+ "@vueuse/core": "^11.1.0",
97
98
  "body-scroll-lock": "4.0.0-beta.0",
98
99
  "dayjs": "^1.11.13",
99
100
  "eslint": "8.57.0",
@@ -103,18 +104,18 @@
103
104
  "lodash-es": "^4.17.21",
104
105
  "markdown-it": "^14.1.0",
105
106
  "normalize.css": "^8.0.1",
106
- "pinia": "^2.2.2",
107
- "postcss": "^8.4.45",
107
+ "pinia": "^2.2.4",
108
+ "postcss": "^8.4.47",
108
109
  "postcss-nested": "^6.2.0",
109
110
  "punycode": "^2.3.1",
110
- "release-it": "^17.6.0",
111
- "typescript": "~5.5.4",
111
+ "release-it": "^17.7.0",
112
+ "typescript": "~5.6.2",
112
113
  "v-calendar": "3.0.1",
113
- "vite": "^5.4.3",
114
- "vitepress": "^1.3.4",
115
- "vitest": "^2.0.5",
116
- "vue": "^3.5.1",
117
- "vue-router": "^4.4.3",
114
+ "vite": "^5.4.8",
115
+ "vitepress": "^1.4.0",
116
+ "vitest": "^2.1.2",
117
+ "vue": "^3.5.11",
118
+ "vue-router": "^4.4.5",
118
119
  "vue-tsc": "^2.1.6"
119
120
  }
120
121
  }