@bagelink/vue 1.14.0 → 1.14.10
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/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/ArrayInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/form-flow/form-flow.d.ts.map +1 -1
- package/dist/index.cjs +122 -93
- package/dist/index.mjs +14780 -14718
- package/dist/style.css +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/ipapi.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/ArrayInput.vue +34 -6
- package/src/components/form/inputs/RichText/editor.css +2 -2
- package/src/components/form/inputs/RichText/index.vue +62 -4
- package/src/form-flow/form-flow.ts +2 -2
- package/src/styles/mobilLayout.css +1 -1
- package/src/styles/text.css +1559 -528
- package/src/utils/index.ts +2 -2
- package/src/utils/ipapi.ts +19 -6
package/src/utils/index.ts
CHANGED
|
@@ -210,8 +210,8 @@ export type { ShowdownConverter, ShowdownOptions } from './showdown'
|
|
|
210
210
|
|
|
211
211
|
const URL_REGEX = /^https?:\/\/|^\/\//
|
|
212
212
|
|
|
213
|
-
export function pathKeyToURL(pathKey?: string) {
|
|
214
|
-
if (pathKey
|
|
213
|
+
export function pathKeyToURL(pathKey?: string | null) {
|
|
214
|
+
if (pathKey == null || pathKey === '' || URL_REGEX.test(pathKey)) {
|
|
215
215
|
return pathKey
|
|
216
216
|
}
|
|
217
217
|
|
package/src/utils/ipapi.ts
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import axios from 'axios'
|
|
2
2
|
|
|
3
|
+
let pendingRequest: Promise<any> | null = null
|
|
4
|
+
|
|
3
5
|
export async function ipapi() {
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const apiData = sessionStorage.getItem('ipapi')
|
|
7
|
+
if (apiData) {
|
|
8
|
+
return JSON.parse(apiData)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Deduplicate concurrent calls — share a single in-flight request
|
|
12
|
+
if (!pendingRequest) {
|
|
13
|
+
pendingRequest = axios.get('https://ipapi.co/json/').then(res => {
|
|
14
|
+
const data = JSON.stringify(res.data)
|
|
15
|
+
sessionStorage.setItem('ipapi', data)
|
|
16
|
+
pendingRequest = null
|
|
17
|
+
return res.data
|
|
18
|
+
}).catch(err => {
|
|
19
|
+
pendingRequest = null
|
|
20
|
+
throw err
|
|
21
|
+
})
|
|
9
22
|
}
|
|
10
|
-
return
|
|
23
|
+
return pendingRequest
|
|
11
24
|
}
|