@supersoniks/concorde 3.0.1 → 3.0.2

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.
Files changed (35) hide show
  1. package/build-infos.json +1 -1
  2. package/index.html +124 -36
  3. package/package.json +16 -5
  4. package/postcss.config.cjs +6 -0
  5. package/public/css/docs.css +0 -0
  6. package/public/img/concorde-logo.svg +1 -0
  7. package/public/img/concorde.png +0 -0
  8. package/public/img/concorde_def.png +0 -0
  9. package/public/svg/regular/plane.svg +1 -0
  10. package/public/svg/solid/plane.svg +1 -0
  11. package/scripts/create-search.js +92 -0
  12. package/scripts/post-build-docs.js +48 -0
  13. package/scripts/post-build.mjs +14 -0
  14. package/src/core/components/functional/queue/queue.ts +72 -28
  15. package/src/core/components/functional/router/router.ts +35 -14
  16. package/src/core/components/functional/states/states.ts +33 -14
  17. package/src/core/directives/Wording.ts +68 -26
  18. package/src/core/mixins/Fetcher.ts +83 -32
  19. package/src/core/utils/Electron.ts +4 -1
  20. package/src/docs/code.ts +4 -3
  21. package/src/docs/example/users.ts +2 -2
  22. package/src/docs/search/docs-search.json +0 -30
  23. package/src/docs/search/search.ts +2 -2
  24. package/src/docs/tailwind/css/tailwind.css +25 -0
  25. package/src/docs/tailwind/index.ts +6 -0
  26. package/src/mixins.ts +1 -1
  27. package/tailwind.config.js +186 -0
  28. package/vite/config.js +22 -22
  29. package/vite.config.mts +16 -14
  30. package/concorde-core.bundle.js +0 -3470
  31. package/concorde-core.es.js +0 -11319
  32. package/scripts/prebuild.mjs +0 -22
  33. package/src/core/components/ui/theme/css/tailwind.css +0 -3
  34. /package/scripts/{postbuild.mjs → pre-build.mjs} +0 -0
  35. /package/src/{core/components/ui/theme → docs/tailwind}/css/tailwind.d.ts +0 -0
package/build-infos.json CHANGED
@@ -1 +1 @@
1
- {"date":1712757332}
1
+ {"date":1712839112}
package/index.html CHANGED
@@ -1,44 +1,132 @@
1
- <!doctype html>
2
- <html lang="en">
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
+ <link rel="icon" type="image/svg+xml" href="src/favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + Lit + TS</title>
8
- <script type="module" src="/src/index.ts"></script>
7
+ <title>Concorde - A supersonic design system</title>
8
+ <link rel="stylesheet" href="https://use.typekit.net/eda3clw.css" />
9
+ <script src="https://cdn.jsdelivr.net/npm/fuzzysort@2.0.1/fuzzysort.min.js"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
11
+ <link href="https://fonts.cdnfonts.com/css/inter" rel="stylesheet" />
12
+ <script type="module" src="/src/docs.ts"></script>
13
+
14
+ <link href="/src/docs/tailwind/css/tailwind.css" rel="stylesheet" />
9
15
  </head>
10
- <body>
11
- <sonic-queue
12
- lazyload
13
- dataproviderexpression="api/users?page=$offset&per_page=$limit"
14
- offset="2"
15
- limit="5"
16
- datafilterprovider="filter"
17
- targetrequestduration="500"
18
- serviceurl="https://reqres.in"
19
- key="data"
20
- debug
21
- >
22
- <template>
23
- <div>
24
- <div class="text-bold text-2xl mb-2">
25
- <span data-bind ::inner-html="$first_name"></span>
26
- <span data-bind ::inner-html="$last_name"></span>
16
+ <body class="px-6 lg:px-20">
17
+ <sonic-theme font background color>
18
+ <sonic-scope markdownsURL="src">
19
+ <div
20
+ class="flex items-center gap-4 border-b-[.3rem] border-current py-3 sticky top-0 z-40 text-neutral-900 bg-neutral-0"
21
+ >
22
+ <div class="font-bold text-4xl">
23
+ <sonic-link href="/">
24
+ <svg
25
+ xmlns="http://www.w3.org/2000/svg"
26
+ width="222.442"
27
+ height="47.558"
28
+ viewBox="0 0 222.442 47.558"
29
+ >
30
+ <g transform="translate(-51.885 -25)">
31
+ <path
32
+ d="M11.045.384A9.984,9.984,0,0,1,5.862-.9,8.546,8.546,0,0,1,2.538-4.474,11.519,11.519,0,0,1,1.381-9.741a11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H14.676a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684A4.416,4.416,0,0,0,7.44-12.976a8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,8.9-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,14.676-7.2h5.139a8.049,8.049,0,0,1-1.221,3.957A7.443,7.443,0,0,1,15.584-.575,10.038,10.038,0,0,1,11.045.384Zm19.7,0A9.985,9.985,0,0,1,25.6-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325A8.6,8.6,0,0,1,25.6-18.62a9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,35.9-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,35.9-.888,9.985,9.985,0,0,1,30.75.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,34.88-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.279,9.279,0,0,0-.467,3.055,9.279,9.279,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,30.776-3.835Zm17.2-7.517V0H42.529V-19.636h5.19v3.464h.23a5.512,5.512,0,0,1,2.186-2.717,6.647,6.647,0,0,1,3.72-1A6.906,6.906,0,0,1,57.423-19a6.091,6.091,0,0,1,2.365,2.55,8.589,8.589,0,0,1,.844,3.944V0H55.185V-11.531a3.968,3.968,0,0,0-.92-2.819,3.315,3.315,0,0,0-2.57-1.016,3.87,3.87,0,0,0-1.937.473,3.253,3.253,0,0,0-1.3,1.374A4.769,4.769,0,0,0,47.975-11.352ZM72.346.384A9.985,9.985,0,0,1,67.162-.9a8.546,8.546,0,0,1-3.324-3.573,11.519,11.519,0,0,1-1.157-5.267,11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H75.977a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684,4.416,4.416,0,0,0-1.464,1.988,8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,70.2-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,75.977-7.2h5.139A8.049,8.049,0,0,1,79.9-3.241,7.443,7.443,0,0,1,76.885-.575,10.038,10.038,0,0,1,72.346.384Zm19.7,0A9.985,9.985,0,0,1,86.905-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325,8.6,8.6,0,0,1,3.343-3.554,9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,97.2-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,97.2-.888,9.985,9.985,0,0,1,92.051.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,96.18-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.278,9.278,0,0,0-.467,3.055,9.278,9.278,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,92.077-3.835ZM103.83,0V-19.636h5.28v3.426h.2a5.1,5.1,0,0,1,1.8-2.768,4.76,4.76,0,0,1,2.915-.94,8.238,8.238,0,0,1,.882.051,6.212,6.212,0,0,1,.831.141v4.832a7.115,7.115,0,0,0-1.061-.2,9.532,9.532,0,0,0-1.24-.089,4.363,4.363,0,0,0-2.141.518,3.847,3.847,0,0,0-1.483,1.438,4.1,4.1,0,0,0-.543,2.122V0Zm19.59.32a7.351,7.351,0,0,1-4.046-1.157,7.876,7.876,0,0,1-2.864-3.413,13.041,13.041,0,0,1-1.055-5.542,12.858,12.858,0,0,1,1.087-5.619,7.829,7.829,0,0,1,2.9-3.362,7.4,7.4,0,0,1,3.969-1.119,6.1,6.1,0,0,1,2.755.556,5.484,5.484,0,0,1,1.79,1.381,7.22,7.22,0,0,1,1.042,1.617h.166v-9.844h5.433V0h-5.369V-3.145h-.23a7,7,0,0,1-1.08,1.617,5.443,5.443,0,0,1-1.8,1.323A6.249,6.249,0,0,1,123.42.32Zm1.726-4.334a3.487,3.487,0,0,0,2.231-.722,4.56,4.56,0,0,0,1.406-2.026,8.637,8.637,0,0,0,.492-3.055,8.632,8.632,0,0,0-.486-3.043,4.367,4.367,0,0,0-1.406-1.994,3.577,3.577,0,0,0-2.237-.7,3.532,3.532,0,0,0-2.263.729,4.456,4.456,0,0,0-1.393,2.02,8.677,8.677,0,0,0-.473,2.991,8.776,8.776,0,0,0,.479,3.023,4.56,4.56,0,0,0,1.393,2.045A3.485,3.485,0,0,0,125.146-4.014Zm21.418,4.4a10.412,10.412,0,0,1-5.21-1.234A8.345,8.345,0,0,1,138-4.353a11.538,11.538,0,0,1-1.176-5.376A11.479,11.479,0,0,1,138-15.047a8.681,8.681,0,0,1,3.317-3.567,9.628,9.628,0,0,1,5.031-1.278,10.393,10.393,0,0,1,3.624.62,8.169,8.169,0,0,1,2.94,1.86,8.473,8.473,0,0,1,1.962,3.113,12.434,12.434,0,0,1,.7,4.379v1.5H139V-11.8H150.45a4.172,4.172,0,0,0-.511-2.084,3.721,3.721,0,0,0-1.413-1.425,4.122,4.122,0,0,0-2.09-.518,4.193,4.193,0,0,0-2.192.569,4.08,4.08,0,0,0-1.489,1.521,4.333,4.333,0,0,0-.55,2.116v3.209a5.462,5.462,0,0,0,.543,2.518,3.889,3.889,0,0,0,1.54,1.636,4.653,4.653,0,0,0,2.365.575,5.15,5.15,0,0,0,1.662-.256,3.449,3.449,0,0,0,1.291-.767,3.335,3.335,0,0,0,.818-1.253l5.037.332A6.866,6.866,0,0,1,153.9-2.461a7.868,7.868,0,0,1-3.043,2.1A11.435,11.435,0,0,1,146.563.384Zm14.31-.051a2.954,2.954,0,0,1-2.167-.9,2.954,2.954,0,0,1-.9-2.167,2.919,2.919,0,0,1,.9-2.148,2.965,2.965,0,0,1,2.167-.895,2.985,2.985,0,0,1,2.148.895,2.889,2.889,0,0,1,.92,2.148,2.884,2.884,0,0,1-.428,1.54,3.286,3.286,0,0,1-1.119,1.112A2.9,2.9,0,0,1,160.873.332Z"
33
+ transform="translate(110.385 62)"
34
+ fill="#2a282d"
35
+ />
36
+ <g transform="translate(51.885 25)">
37
+ <g transform="translate(2.6 2.209)">
38
+ <path
39
+ d="M52.661,65.423h-1.4l-.091-.468h-.208l-.078.351-.078.065H49.646l-.065-.169-.091-.338h-.221v.208l-.118.065-3.859-.326L44.5,64.4v-.871a7.436,7.436,0,0,1,.156-1.079c.182-.883.546-1.962,2.833-5.224s3.08-4.481,4.665-10.3l.078-.324c.468-1.975.806-3.132.936-3.547V34.524a25.625,25.625,0,0,1,.312-2.82h0c.143-.923.312-1.754.468-2.4a21.623,21.623,0,0,0,.195,43.218,41.171,41.171,0,0,1-.845-6.8.668.668,0,0,0-.637-.3Z"
40
+ transform="translate(-33.181 -29.3)"
41
+ fill="#2a282d"
42
+ />
43
+ <path
44
+ d="M34.658,65.423h1.4l.091-.468h.209l.078.351.078.065h1.157l.065-.169.091-.338h.221v.208l.118.065,3.857-.326.793-.416v-.871a7.436,7.436,0,0,0-.156-1.079c-.182-.883-.546-1.962-2.833-5.224s-3.08-4.481-4.665-10.3l-.078-.324c-.468-1.975-.806-3.132-.936-3.547V34.524a25.63,25.63,0,0,0-.312-2.82h0c-.143-.923-.312-1.754-.468-2.4a21.623,21.623,0,0,1-.195,43.218,41.171,41.171,0,0,0,.845-6.8.668.668,0,0,1,.637-.3Z"
45
+ transform="translate(-11.738 -29.3)"
46
+ fill="#2a282d"
47
+ />
48
+ </g>
49
+ <path
50
+ d="M23.779,1.169a22.61,22.61,0,1,0,22.61,22.61,22.61,22.61,0,0,0-22.61-22.61m0-1.169A23.779,23.779,0,1,1,0,23.779,23.779,23.779,0,0,1,23.779,0Z"
51
+ transform="translate(0 0)"
52
+ fill="#2a282d"
53
+ />
54
+ </g>
55
+ </g>
56
+ </svg>
57
+ </sonic-link>
58
+ </div>
59
+ <docs-search class="mx-auto flex-grow block max-w-[32rem] w-full">
60
+ </docs-search>
61
+
62
+ <div>
63
+ <!-- <sonic-button shape="circle" icon variant="ghost">
64
+ <sonic-icon library="iconoir" name="github"></sonic-icon>
65
+ </sonic-button> -->
27
66
  </div>
28
- <sonic-button
29
- data-bind
30
- ::href="mailto|$email"
31
- size="xs"
32
- variant="outline"
33
- >
34
- Contact
35
- </sonic-button>
36
67
  </div>
37
- </div>
38
- <div
39
- class="border-0 border-t-2 border-t-neutral-200 w-full border-solid"
40
- ></div>
41
- </template>
42
- </sonic-queue>
68
+
69
+ <sonic-router>
70
+ <template data-route=".md">
71
+ <div
72
+ class="grid grid-cols-[minmax(10rem,15rem)_minmax(0,1fr)] gap-8"
73
+ >
74
+ <div>
75
+ <docs-navigation
76
+ class="sticky top-[4.2rem] max-h-[calc(100vh_-_4.2rem)] block overflow-auto py-4 custom-scroll"
77
+ ></docs-navigation>
78
+ </div>
79
+ <div class="min-h-[100vh] pt-3">
80
+ <div class="max-w-[80ch] mx-auto block py-8">
81
+ <docs-page noShadowDom class="prose"></docs-page>
82
+ </div>
83
+ </div>
84
+ </div>
85
+ </template>
86
+
87
+ <template data-route="^((?!#).)*$">
88
+ <div
89
+ class="text-4xl leading-none md:text-5xl lg:text-7xl xl:text-8xl max-w-[29ch] lg:max-w-[19ch] mt-9 mb-10 text-neutral-900"
90
+ >
91
+ <!-- webcomponents built with lit to implement
92
+ <span class="font-bold">anywhere, fast, safe and consistent user interfaces. </span> -->
93
+ webcomponents for
94
+ <span class="font-bold"
95
+ >scoped and consistent user interfaces.
96
+ </span>
97
+ <div class="text-base mt-6 -mb-12 relative z-2">
98
+ <div
99
+ class="inline-flex items-center gap-3 text-lg leading-none"
100
+ >
101
+ <sonic-button
102
+ size="2xl"
103
+ variant="outline"
104
+ type="primary"
105
+ href="/#docs/_getting-started/start.md/start"
106
+ >
107
+ <sonic-icon
108
+ name="airplane"
109
+ library="iconoir"
110
+ class="rotate-90 inline-block mr-1"
111
+ ></sonic-icon
112
+ ><span class="font-bold">Get Started</span>
113
+ </sonic-button>
114
+ <sonic-code language="bash" inline noEdit>
115
+ <template>
116
+ npx @supersoniks/create-concorde-ts-starter "MyProject"
117
+ </template></sonic-code
118
+ >
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <sonic-image
123
+ src="/img/concorde.png"
124
+ alt=""
125
+ class="w-full block mix-blend-multiply"
126
+ ></sonic-image>
127
+ </template>
128
+ </sonic-router>
129
+ </sonic-scope>
130
+ </sonic-theme>
43
131
  </body>
44
132
  </html>
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@supersoniks/concorde",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "",
7
7
  "scripts": {
8
- "dev": "vite --host 0.0.0.0 --port 3000",
9
- "prebuild": "node scripts/prebuild.mjs",
10
- "build": "tsc --build src/tsconfig.json && vite build"
8
+ "dev": "node scripts/create-search.js && vite --host 0.0.0.0 --port 3000",
9
+ "prebuild": "node scripts/pre-build.mjs",
10
+ "postbuild": "node scripts/post-build.mjs",
11
+ "build": "tsc --build src/tsconfig.json && vite build",
12
+ "build-docs": "LIB_NAME=docs vite build",
13
+ "postbuild-docs": "node scripts/post-build-docs.js"
11
14
  },
12
15
  "exports": {
13
16
  "./core/components/ui/icon/icons.json": "./src/core/components/ui/icon/icons.json",
@@ -20,13 +23,21 @@
20
23
  "@jest/globals": "^29.7.0",
21
24
  "@lit-labs/motion": "^1.0.7",
22
25
  "@lit-labs/observers": "^2.0.2",
26
+ "@tailwindcss/typography": "^0.5.12",
23
27
  "@types/intl": "^1.2.2",
24
28
  "@types/jest": "^29.5.12",
25
29
  "@types/node": "^20.12.4",
30
+ "autoprefixer": "^10.4.19",
26
31
  "intl": "^1.2.5",
27
- "url-pattern": "^1.0.3",
28
32
  "lit": "^3.0.0",
33
+ "marked": "^12.0.1",
34
+ "marked-gfm-heading-id": "^3.1.3",
35
+ "postcss": "^8.4.38",
36
+ "prismjs": "^1.29.0",
37
+ "rollup-plugin-postcss-lit": "^2.1.0",
38
+ "tailwindcss": "^3.4.3",
29
39
  "typescript": "^5.4.3",
40
+ "url-pattern": "^1.0.3",
30
41
  "vite": "^5.2.8"
31
42
  }
32
43
  }
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
File without changes
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="222.442" height="47.558" viewBox="0 0 222.442 47.558"><g transform="translate(-51.885 -25)"><path d="M11.045.384A9.984,9.984,0,0,1,5.862-.9,8.546,8.546,0,0,1,2.538-4.474,11.519,11.519,0,0,1,1.381-9.741a11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H14.676a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684A4.416,4.416,0,0,0,7.44-12.976a8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,8.9-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,14.676-7.2h5.139a8.049,8.049,0,0,1-1.221,3.957A7.443,7.443,0,0,1,15.584-.575,10.038,10.038,0,0,1,11.045.384Zm19.7,0A9.985,9.985,0,0,1,25.6-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325A8.6,8.6,0,0,1,25.6-18.62a9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,35.9-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,35.9-.888,9.985,9.985,0,0,1,30.75.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,34.88-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.279,9.279,0,0,0-.467,3.055,9.279,9.279,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,30.776-3.835Zm17.2-7.517V0H42.529V-19.636h5.19v3.464h.23a5.512,5.512,0,0,1,2.186-2.717,6.647,6.647,0,0,1,3.72-1A6.906,6.906,0,0,1,57.423-19a6.091,6.091,0,0,1,2.365,2.55,8.589,8.589,0,0,1,.844,3.944V0H55.185V-11.531a3.968,3.968,0,0,0-.92-2.819,3.315,3.315,0,0,0-2.57-1.016,3.87,3.87,0,0,0-1.937.473,3.253,3.253,0,0,0-1.3,1.374A4.769,4.769,0,0,0,47.975-11.352ZM72.346.384A9.985,9.985,0,0,1,67.162-.9a8.546,8.546,0,0,1-3.324-3.573,11.519,11.519,0,0,1-1.157-5.267,11.462,11.462,0,0,1,1.17-5.3,8.651,8.651,0,0,1,3.33-3.567,9.872,9.872,0,0,1,5.139-1.285,10.228,10.228,0,0,1,4.5.933,7.522,7.522,0,0,1,3.055,2.621,7.7,7.7,0,0,1,1.24,3.963H75.977a4.017,4.017,0,0,0-1.144-2.371,3.328,3.328,0,0,0-2.423-.9,3.647,3.647,0,0,0-2.205.684,4.416,4.416,0,0,0-1.464,1.988,8.472,8.472,0,0,0-.524,3.158,8.75,8.75,0,0,0,.518,3.2A4.393,4.393,0,0,0,70.2-4.615a3.651,3.651,0,0,0,2.212.69,3.63,3.63,0,0,0,1.681-.384,3.279,3.279,0,0,0,1.24-1.119A4.261,4.261,0,0,0,75.977-7.2h5.139A8.049,8.049,0,0,1,79.9-3.241,7.443,7.443,0,0,1,76.885-.575,10.038,10.038,0,0,1,72.346.384Zm19.7,0A9.985,9.985,0,0,1,86.905-.888a8.6,8.6,0,0,1-3.343-3.554,11.411,11.411,0,0,1-1.176-5.3,11.469,11.469,0,0,1,1.176-5.325,8.6,8.6,0,0,1,3.343-3.554,9.985,9.985,0,0,1,5.146-1.272A9.985,9.985,0,0,1,97.2-18.62a8.6,8.6,0,0,1,3.343,3.554,11.469,11.469,0,0,1,1.176,5.325,11.411,11.411,0,0,1-1.176,5.3A8.6,8.6,0,0,1,97.2-.888,9.985,9.985,0,0,1,92.051.384Zm.026-4.219a3.367,3.367,0,0,0,2.263-.773,4.757,4.757,0,0,0,1.374-2.116A9.279,9.279,0,0,0,96.18-9.78a9.279,9.279,0,0,0-.467-3.055,4.8,4.8,0,0,0-1.374-2.122,3.35,3.35,0,0,0-2.263-.78,3.443,3.443,0,0,0-2.295.78,4.726,4.726,0,0,0-1.393,2.122,9.278,9.278,0,0,0-.467,3.055,9.278,9.278,0,0,0,.467,3.055,4.681,4.681,0,0,0,1.393,2.116A3.461,3.461,0,0,0,92.077-3.835ZM103.83,0V-19.636h5.28v3.426h.2a5.1,5.1,0,0,1,1.8-2.768,4.76,4.76,0,0,1,2.915-.94,8.238,8.238,0,0,1,.882.051,6.212,6.212,0,0,1,.831.141v4.832a7.115,7.115,0,0,0-1.061-.2,9.532,9.532,0,0,0-1.24-.089,4.363,4.363,0,0,0-2.141.518,3.847,3.847,0,0,0-1.483,1.438,4.1,4.1,0,0,0-.543,2.122V0Zm19.59.32a7.351,7.351,0,0,1-4.046-1.157,7.876,7.876,0,0,1-2.864-3.413,13.041,13.041,0,0,1-1.055-5.542,12.858,12.858,0,0,1,1.087-5.619,7.829,7.829,0,0,1,2.9-3.362,7.4,7.4,0,0,1,3.969-1.119,6.1,6.1,0,0,1,2.755.556,5.484,5.484,0,0,1,1.79,1.381,7.22,7.22,0,0,1,1.042,1.617h.166v-9.844h5.433V0h-5.369V-3.145h-.23a7,7,0,0,1-1.08,1.617,5.443,5.443,0,0,1-1.8,1.323A6.249,6.249,0,0,1,123.42.32Zm1.726-4.334a3.487,3.487,0,0,0,2.231-.722,4.56,4.56,0,0,0,1.406-2.026,8.637,8.637,0,0,0,.492-3.055,8.632,8.632,0,0,0-.486-3.043,4.367,4.367,0,0,0-1.406-1.994,3.577,3.577,0,0,0-2.237-.7,3.532,3.532,0,0,0-2.263.729,4.456,4.456,0,0,0-1.393,2.02,8.677,8.677,0,0,0-.473,2.991,8.776,8.776,0,0,0,.479,3.023,4.56,4.56,0,0,0,1.393,2.045A3.485,3.485,0,0,0,125.146-4.014Zm21.418,4.4a10.412,10.412,0,0,1-5.21-1.234A8.345,8.345,0,0,1,138-4.353a11.538,11.538,0,0,1-1.176-5.376A11.479,11.479,0,0,1,138-15.047a8.681,8.681,0,0,1,3.317-3.567,9.628,9.628,0,0,1,5.031-1.278,10.393,10.393,0,0,1,3.624.62,8.169,8.169,0,0,1,2.94,1.86,8.473,8.473,0,0,1,1.962,3.113,12.434,12.434,0,0,1,.7,4.379v1.5H139V-11.8H150.45a4.172,4.172,0,0,0-.511-2.084,3.721,3.721,0,0,0-1.413-1.425,4.122,4.122,0,0,0-2.09-.518,4.193,4.193,0,0,0-2.192.569,4.08,4.08,0,0,0-1.489,1.521,4.333,4.333,0,0,0-.55,2.116v3.209a5.462,5.462,0,0,0,.543,2.518,3.889,3.889,0,0,0,1.54,1.636,4.653,4.653,0,0,0,2.365.575,5.15,5.15,0,0,0,1.662-.256,3.449,3.449,0,0,0,1.291-.767,3.335,3.335,0,0,0,.818-1.253l5.037.332A6.866,6.866,0,0,1,153.9-2.461a7.868,7.868,0,0,1-3.043,2.1A11.435,11.435,0,0,1,146.563.384Zm14.31-.051a2.954,2.954,0,0,1-2.167-.9,2.954,2.954,0,0,1-.9-2.167,2.919,2.919,0,0,1,.9-2.148,2.965,2.965,0,0,1,2.167-.895,2.985,2.985,0,0,1,2.148.895,2.889,2.889,0,0,1,.92,2.148,2.884,2.884,0,0,1-.428,1.54,3.286,3.286,0,0,1-1.119,1.112A2.9,2.9,0,0,1,160.873.332Z" transform="translate(110.385 62)" fill="#2a282d"/><g transform="translate(51.885 25)"><g transform="translate(2.6 2.209)"><path d="M52.661,65.423h-1.4l-.091-.468h-.208l-.078.351-.078.065H49.646l-.065-.169-.091-.338h-.221v.208l-.118.065-3.859-.326L44.5,64.4v-.871a7.436,7.436,0,0,1,.156-1.079c.182-.883.546-1.962,2.833-5.224s3.08-4.481,4.665-10.3l.078-.324c.468-1.975.806-3.132.936-3.547V34.524a25.625,25.625,0,0,1,.312-2.82h0c.143-.923.312-1.754.468-2.4a21.623,21.623,0,0,0,.195,43.218,41.171,41.171,0,0,1-.845-6.8.668.668,0,0,0-.637-.3Z" transform="translate(-33.181 -29.3)" fill="#2a282d"/><path d="M34.658,65.423h1.4l.091-.468h.209l.078.351.078.065h1.157l.065-.169.091-.338h.221v.208l.118.065,3.857-.326.793-.416v-.871a7.436,7.436,0,0,0-.156-1.079c-.182-.883-.546-1.962-2.833-5.224s-3.08-4.481-4.665-10.3l-.078-.324c-.468-1.975-.806-3.132-.936-3.547V34.524a25.63,25.63,0,0,0-.312-2.82h0c-.143-.923-.312-1.754-.468-2.4a21.623,21.623,0,0,1-.195,43.218,41.171,41.171,0,0,0,.845-6.8.668.668,0,0,1,.637-.3Z" transform="translate(-11.738 -29.3)" fill="#2a282d"/></g><path d="M23.779,1.169a22.61,22.61,0,1,0,22.61,22.61,22.61,22.61,0,0,0-22.61-22.61m0-1.169A23.779,23.779,0,1,1,0,23.779,23.779,23.779,0,0,1,23.779,0Z" transform="translate(0 0)" fill="#2a282d"/></g></g></svg>
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M576 256C576 305 502.1 336 464.2 336H382.2L282.4 496C276.4 506 266.4 512 254.4 512H189.5C179.5 512 169.5 508 163.5 500C157.6 492 155.6 480.1 158.6 471L201.5 336H152.5L113.6 388C107.6 396 98.61 400 88.62 400H31.7C22.72 400 12.73 396 6.74 388C.7485 380-1.248 370 1.747 360L31.7 256L.7488 152C-1.248 143 .7488 133 6.74 125C12.73 117 22.72 112 31.7 112H88.62C98.61 112 107.6 117 113.6 125L152.5 176H201.5L158.6 41C155.6 32 157.6 21 163.5 13C169.5 5 179.5 0 189.5 0H254.4C265.4 0 277.4 7 281.4 16L381.2 176H463.2C502.1 176 576 208 576 256H576zM527.1 256C525.1 246 489.1 224 463.2 224H355.3L245.4 48H211.5L266.4 224H128.6L80.63 160H53.67L81.63 256L53.67 352H80.63L128.6 288H266.4L211.5 464H245.4L355.3 288H463.2C490.1 288 526.1 267 527.1 256V256z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M482.3 192c34.2 0 93.7 29 93.7 64c0 36-59.5 64-93.7 64l-116.6 0L265.2 495.9c-5.7 10-16.3 16.1-27.8 16.1l-56.2 0c-10.6 0-18.3-10.2-15.4-20.4l49-171.6L112 320 68.8 377.6c-3 4-7.8 6.4-12.8 6.4l-42 0c-7.8 0-14-6.3-14-14c0-1.3 .2-2.6 .5-3.9L32 256 .5 145.9c-.4-1.3-.5-2.6-.5-3.9c0-7.8 6.3-14 14-14l42 0c5 0 9.8 2.4 12.8 6.4L112 192l102.9 0-49-171.6C162.9 10.2 170.6 0 181.2 0l56.2 0c11.5 0 22.1 6.2 27.8 16.1L365.7 192l116.6 0z"/></svg>
@@ -0,0 +1,92 @@
1
+ import fs from "fs";
2
+
3
+ // import stopWords from "../json/stopWords.json";
4
+ import { marked } from "marked";
5
+ import { gfmHeadingId } from "marked-gfm-heading-id"
6
+ marked.use(gfmHeadingId());
7
+
8
+ let currentHash = null;
9
+ let currentHashTitle = null;
10
+ let sourcePath = "src";
11
+ let result = [];
12
+ let title = "";
13
+ let types = [];
14
+ function listFiles(path) {
15
+ let files = fs.readdirSync(path);
16
+ files.forEach(function (file) {
17
+ let filePath = path + "/" + file;
18
+ if (fs.statSync(filePath).isDirectory()) {
19
+ listFiles(filePath);
20
+ } else {
21
+ if (!["md", "mdx"].includes(file.substring(file.lastIndexOf(".") + 1))) return;
22
+ let lexedFile = marked.lexer(fs.readFileSync(filePath).toString());
23
+ computeFileSearch(lexedFile, filePath);
24
+ }
25
+ });
26
+ }
27
+
28
+ function computeFileSearch(lexed, filePath) {
29
+ currentHash = null;
30
+ title = "";
31
+ for (const elt of lexed) {
32
+ computeNodeSearch(elt, filePath);
33
+ }
34
+ }
35
+
36
+ function computeNodeSearch(node, filePath) {
37
+ if (!types.includes(node.type)) types.push(node.type);
38
+ if (node.type == "heading") {
39
+ if (!title) title = node.text;
40
+ const parsed = marked.parse(node.raw);
41
+
42
+ if (parsed.match(/id="(.*?)"/)) {
43
+ currentHash = parsed.match(/id="(.*?)"/)[1];
44
+ currentHashTitle = node.text;
45
+ if (currentHashTitle == title) {
46
+ currentHashTitle = "";
47
+ addWord(title, filePath, "page");
48
+ }
49
+ } else {
50
+ console.log("no hash", filePath, node.raw, parsed);
51
+ console.log(marked.parse("# heading 2\n\n## heading 3"));
52
+ }
53
+ }
54
+ if (node.type == "paragraph") {
55
+ computeTextSearch(marked.parse(node.raw), filePath, node.type);
56
+ } else if (node.tokens) {
57
+ for (const token of node.tokens) {
58
+ computeNodeSearch(token, filePath);
59
+ }
60
+ }
61
+ }
62
+
63
+ function computeTextSearch(text, filePath, nodeType) {
64
+ text = text.replace(/\<sonic\-code(.|\s)*?\<\/sonic\-code.*?>/gm, "").replace(/<[^>]*>?/gm, "");
65
+ // let split = text
66
+ // .toLowerCase()
67
+ // .normalize("NFD")
68
+ // .replace(/[\u0300-\u036f]/g, "")
69
+ // .replace(/[^a-zA-Z \-]/g, " ")
70
+ // .split(/\s/)
71
+ // .map((e) => e.trim())
72
+ // .filter((e) => e.length > 3 && stopWords.indexOf(e) == -1);
73
+ addWord(text, filePath, nodeType);
74
+ }
75
+
76
+ function addWord(word, filePath, nodeType) {
77
+ filePath = filePath.replace(sourcePath + "/", "");
78
+ let wordResult = result.find((e) => e.search == word);
79
+
80
+ if (!wordResult) {
81
+ wordResult = { search: word, files: {} };
82
+ result.push(wordResult);
83
+ }
84
+ if (!wordResult.files[filePath]) wordResult.files[filePath] = { title: title, hashes: {} };
85
+ let path = wordResult.files[filePath].hashes;
86
+ if (!path[currentHash]) path[currentHash] = { count: 0, title: currentHashTitle };
87
+ path[currentHash].count++;
88
+ path[currentHash].type = nodeType;
89
+ }
90
+
91
+ listFiles(sourcePath);
92
+ fs.writeFileSync("src/docs/search/docs-search.json", JSON.stringify(result, null, " "));
@@ -0,0 +1,48 @@
1
+ import fs from "fs";
2
+ import path from "path";
3
+
4
+ const src = path.resolve("src");
5
+ const docs = path.resolve("docs");
6
+ /**
7
+ * lister les fichiers d'un répertoire de manière récursive
8
+ */
9
+ function listFiles(dir) {
10
+ let files = [];
11
+ let list = fs.readdirSync(dir);
12
+ list.forEach((file) => {
13
+ const path = dir + "/" + file;
14
+ let stat = fs.statSync(path);
15
+ if (stat && stat.isDirectory()) {
16
+ files = files.concat(listFiles(path));
17
+ } else {
18
+ files.push(path);
19
+ }
20
+ });
21
+ return files;
22
+ }
23
+
24
+ /**
25
+ * copier toues les fichiers .md présents dans le répertpoire src et ses sous dossiers de manière récurcive vers dossier docs en respectant l'arborescence qu'il y avait dans le dossier src
26
+ * il faut creer le chemin si il n'existe pas avant de copier le fichier
27
+ */
28
+ function copyDocs() {
29
+ let files = listFiles(src);
30
+ for (const file of files) {
31
+ console.log(file);
32
+ if (file.indexOf(".md") != -1 || file.indexOf(".json") != -1) {
33
+ let idx = file.indexOf("src/");
34
+ let dest = file.substring(idx);
35
+ let split = dest.split("/");
36
+ let dir = path.resolve(docs);
37
+ for (let i = 0; i < split.length - 1; i++) {
38
+ dir += "/" + split[i];
39
+ if (!fs.existsSync(dir)) {
40
+ fs.mkdirSync(dir);
41
+ }
42
+ }
43
+ dir += "/" + split[split.length - 1];
44
+ fs.copyFileSync(file, dir);
45
+ }
46
+ }
47
+ }
48
+ copyDocs();
@@ -0,0 +1,14 @@
1
+ // console.log("hey");
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+
6
+ //copy concorde-core.bundle.js and concorde-core.es.js from docs to the root of the project
7
+ fs.copyFileSync(
8
+ path.resolve("dist/concorde-core.bundle.js"),
9
+ path.resolve("concorde-core.bundle.js")
10
+ );
11
+ fs.copyFileSync(
12
+ path.resolve("dist/concorde-core.es.js"),
13
+ path.resolve("concorde-core.es.js")
14
+ );
@@ -1,11 +1,11 @@
1
- import {html, LitElement, nothing} from "lit";
2
- import {customElement, property} from "lit/decorators.js";
1
+ import { html, LitElement, nothing } from "lit";
2
+ import { customElement, property } from "lit/decorators.js";
3
3
  import Subscriber from "@supersoniks/concorde/core/mixins/Subscriber";
4
- import {map} from "lit/directives/map.js";
5
- import {PublisherManager} from "@supersoniks/concorde/core/utils/PublisherProxy";
4
+ import { map } from "lit/directives/map.js";
5
+ import { PublisherManager } from "@supersoniks/concorde/core/utils/PublisherProxy";
6
6
  import "@supersoniks/concorde/core/components/functional/list/list";
7
- import {PublisherProxy} from "@supersoniks/concorde/core/utils/PublisherProxy";
8
- import {HTML} from "@supersoniks/concorde/utils";
7
+ import { PublisherProxy } from "@supersoniks/concorde/core/utils/PublisherProxy";
8
+ import { HTML } from "@supersoniks/concorde/utils";
9
9
 
10
10
  type QueueItem = {
11
11
  id: string;
@@ -14,7 +14,10 @@ type QueueItem = {
14
14
  offset: number;
15
15
  limit: number;
16
16
  };
17
- type QueueProps = QueueItem[] & {resultCount?: number; lastFetchedData?: unknown};
17
+ type QueueProps = QueueItem[] & {
18
+ resultCount?: number;
19
+ lastFetchedData?: unknown;
20
+ };
18
21
 
19
22
  const tagName = "sonic-queue";
20
23
  /**
@@ -27,11 +30,12 @@ const tagName = "sonic-queue";
27
30
  */
28
31
  @customElement(tagName)
29
32
  export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
30
- @property({type: Array}) templates: Array<HTMLTemplateElement> | null = null;
33
+ @property({ type: Array }) templates: Array<HTMLTemplateElement> | null =
34
+ null;
31
35
  lastRequestTime = 0;
32
36
  key = "";
33
37
 
34
- @property({type: Object}) itemPropertyMap: object | null = null;
38
+ @property({ type: Object }) itemPropertyMap: object | null = null;
35
39
  /**
36
40
  * Durée cible en ms d'une requête pour afficher 1 lot.
37
41
  */
@@ -46,7 +50,7 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
46
50
 
47
51
  @property() offset = 0;
48
52
  @property() resultCount = 0;
49
- @property({type: Boolean}) noLazyload = false;
53
+ @property({ type: Boolean }) noLazyload = false;
50
54
 
51
55
  @property() filteredFields = "";
52
56
  disconnectedCallback() {
@@ -74,34 +78,48 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
74
78
  async connectedCallback() {
75
79
  this.instanceId = Queue.instanceCounter++;
76
80
  this.localStorage = this.getAttribute("localStorage") || this.localStorage;
77
- this.filterTimeoutMs = parseInt(this.getAttribute("filterTimeoutMs") || "400");
81
+ this.filterTimeoutMs = parseInt(
82
+ this.getAttribute("filterTimeoutMs") || "400"
83
+ );
78
84
  //On supprime l'attribut car une queue ne doi pas être en localstorage, ce sont ses sous composants list qui doivent l'être
79
85
  this.removeAttribute("localStorage");
80
86
  this.noShadowDom = "";
81
87
  this.defferedDebug = this.hasAttribute("debug") || null;
82
88
  /**Compat avec states et routing **/
83
89
  if (!this.dataProvider)
84
- this.dataProvider = this.dataProviderExpression || "sonic-queue-" + this.instanceId + "-" + Math.random().toString(36).substring(7);
90
+ this.dataProvider =
91
+ this.dataProviderExpression ||
92
+ "sonic-queue-" +
93
+ this.instanceId +
94
+ "-" +
95
+ Math.random().toString(36).substring(7);
85
96
  if (!this.dataProviderExpression) {
86
- this.dataProviderExpression = HTML.getAncestorAttributeValue(this.parentElement, "dataProvider") || "";
97
+ this.dataProviderExpression =
98
+ HTML.getAncestorAttributeValue(this.parentElement, "dataProvider") ||
99
+ "";
87
100
  }
88
101
  super.connectedCallback();
89
102
  this.publisher.set({});
90
103
  this.key = this.getAttribute("key");
91
104
  await PublisherManager.getInstance().isLocalStrorageReady;
92
- if (!this.templates) this.templates = Array.from(this.querySelectorAll("template")) as Array<HTMLTemplateElement>;
105
+ if (!this.templates)
106
+ this.templates = Array.from(
107
+ this.querySelectorAll("template")
108
+ ) as Array<HTMLTemplateElement>;
93
109
  this.lastRequestTime = new Date().getTime();
94
110
  this.configFilter();
95
111
  }
96
112
  filterPublisher: PublisherProxy | null = null;
97
113
  configFilter() {
98
- const dataFilterProvider = this.getAncestorAttributeValue("dataFilterProvider");
114
+ const dataFilterProvider =
115
+ this.getAncestorAttributeValue("dataFilterProvider");
99
116
  if (!dataFilterProvider) {
100
117
  this.next();
101
118
  return;
102
119
  }
103
120
 
104
- this.filterPublisher = PublisherManager.getInstance().get(dataFilterProvider);
121
+ this.filterPublisher =
122
+ PublisherManager.getInstance().get(dataFilterProvider);
105
123
  this.filterPublisher?.onInternalMutation(this.updateFilteredContent);
106
124
  }
107
125
  filterTimeoutId?: ReturnType<typeof setTimeout>;
@@ -117,12 +135,19 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
117
135
  const split = dataProvider.split("?");
118
136
  split.shift();
119
137
  const searchParams = new URLSearchParams(split.join("?"));
120
- const filterData: Record<string, string | string[]> = this.filterPublisher?.get();
138
+ const filterData: Record<string, string | string[]> =
139
+ this.filterPublisher?.get();
121
140
  const filteredFieldsArray = this.filteredFields.split(" ");
122
141
  for (const f in filterData) {
123
142
  let value = filterData[f];
124
- if (Array.isArray(value)) value = value.filter((v: string | null) => v !== null);
125
- if ((this.filteredFields && !filteredFieldsArray.includes(f)) || value == null || value.toString() === "") continue;
143
+ if (Array.isArray(value))
144
+ value = value.filter((v: string | null) => v !== null);
145
+ if (
146
+ (this.filteredFields && !filteredFieldsArray.includes(f)) ||
147
+ value == null ||
148
+ value.toString() === ""
149
+ )
150
+ continue;
126
151
  searchParams.set(f, filterData[f].toString());
127
152
  }
128
153
  const searchHash = searchParams.toString();
@@ -160,9 +185,9 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
160
185
  * * l'expression *$limit* est remplacée par la valeur représentant le nombre d'éléments à charger
161
186
  * * Si pas d'expression *$offset* le composant se comporte un peu comme une liste, il ne va pas essayer de charger les éléments suivants
162
187
  */
163
- @property({type: String}) dataProviderExpression = "";
188
+ @property({ type: String }) dataProviderExpression = "";
164
189
 
165
- @property({type: String}) idKey = "id";
190
+ @property({ type: String }) idKey = "id";
166
191
 
167
192
  resetDuration() {
168
193
  this.lastRequestTime = new Date().getTime();
@@ -191,7 +216,11 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
191
216
  if (e.detail.requestId < this.requestId) return;
192
217
  this.resultCount += e.detail.props.length;
193
218
 
194
- if (!e.detail.isFirstLoad || !e.detail.props.length || this.dataProviderExpression.indexOf("$offset") == -1) {
219
+ if (
220
+ !e.detail.isFirstLoad ||
221
+ !e.detail.props.length ||
222
+ this.dataProviderExpression.indexOf("$offset") == -1
223
+ ) {
195
224
  this.publisher.resultCount = this.resultCount;
196
225
  // this.publisher.lastFetchedData = {};
197
226
  return;
@@ -203,16 +232,21 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
203
232
  newProps.lastFetchedData = e?.detail.fetchedData || {};
204
233
  this.props = newProps;
205
234
  } else {
206
- const props: Array<{offset: number; limit: number}> = this.props;
235
+ const props: Array<{ offset: number; limit: number }> = this.props;
207
236
  const item = props[props.length - 1];
208
- offset = parseInt(item.offset.toString()) + parseInt(item.limit.toString());
237
+ offset =
238
+ parseInt(item.offset.toString()) + parseInt(item.limit.toString());
209
239
  }
210
240
  if (requestDuration > 0 && e && !this.localStorage) {
211
- this.limit = Math.round((this.limit / requestDuration) * this.targetRequestDuration);
241
+ this.limit = Math.round(
242
+ (this.limit / requestDuration) * this.targetRequestDuration
243
+ );
212
244
  }
213
245
  if (this.limit < 1) this.limit = 1;
214
246
  if (this.limit > 15) this.limit = 15;
215
- let dataProvider = this.dataProviderExpression.replace("$offset", offset + "").replace("$limit", this.limit + "");
247
+ let dataProvider = this.dataProviderExpression
248
+ .replace("$offset", offset + "")
249
+ .replace("$limit", this.limit + "");
216
250
  const split = dataProvider.split("?");
217
251
  let endpoint = split.shift();
218
252
  const searchParams = new URLSearchParams(split.join("?"));
@@ -220,7 +254,12 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
220
254
  const filteredFieldsArray = this.filteredFields.split(" ");
221
255
 
222
256
  for (const f in filterData) {
223
- if ((this.filteredFields && filteredFieldsArray.includes(f)) || filterData[f] == null || filterData[f] == "") continue;
257
+ if (
258
+ (this.filteredFields && filteredFieldsArray.includes(f)) ||
259
+ filterData[f] == null ||
260
+ filterData[f] == ""
261
+ )
262
+ continue;
224
263
  searchParams.set(f, filterData[f]);
225
264
  }
226
265
  if (!this.searchHash) this.searchHash = searchParams.toString();
@@ -250,7 +289,12 @@ export default class Queue extends Subscriber(LitElement, {} as QueueProps) {
250
289
  }
251
290
  return html`
252
291
  ${map(this.props, (item, index) => {
253
- const templates = index == 0 ? this.templates : this.templates?.filter((elt) => elt.getAttribute("data-value") != "no-item");
292
+ const templates =
293
+ index == 0
294
+ ? this.templates
295
+ : this.templates?.filter(
296
+ (elt) => elt.getAttribute("data-value") != "no-item"
297
+ );
254
298
  return html`
255
299
  <sonic-list
256
300
  fetch