rimecms 0.26.6 → 0.26.7

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.
@@ -109,8 +109,7 @@
109
109
  });
110
110
  }
111
111
  }
112
-
113
- return url.pathname + url.search;
112
+ return url.href + url.search;
114
113
  }
115
114
 
116
115
  const ressourceURL = makeRessourceURL();
@@ -4,7 +4,7 @@
4
4
  import Button from '../../../../../panel/components/ui/button/button.svelte';
5
5
  import CardResource from '../../../../../panel/components/ui/card-resource/card-resource.svelte';
6
6
  import * as Command from '../../../../../panel/components/ui/command/index.js';
7
- import { API_PROXY, setAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
7
+ import { API_PROXY, getAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
8
8
  import type { NodeViewProps } from '@tiptap/core';
9
9
  import { onMount } from 'svelte';
10
10
  import NodeViewWrapper from '../../svelte/node-view-wrapper.svelte';
@@ -37,14 +37,11 @@
37
37
  }
38
38
  });
39
39
 
40
- // Need to set a local APIProxy because the app one is not
41
- // available from inside tiptap rendered components
42
- // TODO try to pass it as a prop somehow
43
- const APIProxy = setAPIProxyContext(API_PROXY.TIPTAP);
40
+ const APIProxy = getAPIProxyContext(API_PROXY.DOCUMENT);
44
41
 
45
42
  // svelte-ignore state_referenced_locally
46
43
  const url = extension.options.query
47
- ? apiUrl(extension.options.slug, extension.options.query)
44
+ ? apiUrl(extension.options.slug, `?${extension.options.query}`)
48
45
  : apiUrl(extension.options.slug);
49
46
 
50
47
  const ressource = APIProxy.getRessource<{ docs: GenericDoc[] }>(url);
@@ -114,7 +111,7 @@
114
111
  </div>
115
112
  </NodeViewWrapper>
116
113
 
117
- <Command.Dialog bind:open={isDialogOpen} onOpenChange={(val) => (isDialogOpen = val)}>
114
+ <Command.Dialog bind:open={isDialogOpen}>
118
115
  <Command.Input placeholder="Select a resource" />
119
116
 
120
117
  <Command.List>
@@ -6,7 +6,7 @@
6
6
  import * as Command from '../../../../../panel/components/ui/command/index.js';
7
7
  import * as Dialog from '../../../../../panel/components/ui/dialog/index.js';
8
8
  import Input from '../../../../../panel/components/ui/input/input.svelte';
9
- import { API_PROXY, setAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
9
+ import { API_PROXY, getAPIProxyContext } from '../../../../../panel/context/api-proxy.svelte.js';
10
10
  import { X } from '@lucide/svelte';
11
11
  import type { NodeViewProps } from '@tiptap/core';
12
12
  import { onMount } from 'svelte';
@@ -51,18 +51,14 @@
51
51
  }
52
52
  } else {
53
53
  selected = null;
54
- isDialogOpen = true;
55
54
  }
56
55
  });
57
56
 
58
- // Need to set a local APIProxy because the app one is not
59
- // available from inside tiptap rendered components
60
- // TODO try to pass it as a prop in a near future
61
- const APIProxy = setAPIProxyContext(API_PROXY.TIPTAP);
57
+ const APIProxy = getAPIProxyContext(API_PROXY.DOCUMENT);
62
58
 
63
59
  // svelte-ignore state_referenced_locally
64
60
  const url = extension.options.query
65
- ? apiUrl(extension.options.slug, extension.options.query)
61
+ ? apiUrl(extension.options.slug, `?${extension.options.query}`)
66
62
  : apiUrl(extension.options.slug);
67
63
 
68
64
  const ressource = APIProxy.getRessource<{ docs: UploadDoc[] }>(url);
@@ -128,9 +124,9 @@
128
124
  <NodeViewWrapper>
129
125
  <div data-drag-handle class="rz-richtext-media" class:rz-richtext-media--selected={!!selected}>
130
126
  {#if !selected}
131
- <Button class="rz-richtext-media__add" variant="outline" onclick={handleClick}
132
- >Add a media</Button
133
- >
127
+ <Button class="rz-richtext-media__add" variant="outline" onclick={handleClick}>
128
+ Add a media
129
+ </Button>
134
130
  {:else}
135
131
  <div class="rz-richtext-media__actions">
136
132
  <Button
@@ -181,7 +177,7 @@
181
177
  </div>
182
178
  {/snippet}
183
179
 
184
- <Command.Dialog bind:open={isDialogOpen} onOpenChange={(val) => (isDialogOpen = val)}>
180
+ <Command.Dialog bind:open={isDialogOpen}>
185
181
  <Command.Input placeholder="Select an image" />
186
182
 
187
183
  <Command.List>
@@ -1,24 +1,25 @@
1
- export type Resource<T = any> = {
2
- data: T | null;
3
- isLoading: boolean;
4
- error: any;
5
- url: string;
6
- refresh: () => void;
7
- };
8
- type GetResourcesOptions<T> = {
9
- transformData?: (input: any) => T;
10
- };
11
1
  export declare function setAPIProxyContext(key?: symbol): {
12
2
  getRessource: <T>(url: string, options?: GetResourcesOptions<T>) => Resource<T>;
13
3
  invalidateAll: () => void;
4
+ readonly urls: string[];
14
5
  };
15
6
  export declare function getAPIProxyContext(key?: symbol): {
16
7
  getRessource: <T>(url: string, options?: GetResourcesOptions<T>) => Resource<T>;
17
8
  invalidateAll: () => void;
9
+ readonly urls: string[];
18
10
  };
19
11
  export declare const API_PROXY: {
20
12
  DOCUMENT: symbol;
21
13
  ROOT: symbol;
22
- TIPTAP: symbol;
14
+ };
15
+ export type Resource<T = any> = {
16
+ data: T | null;
17
+ isLoading: boolean;
18
+ error: any;
19
+ url: string;
20
+ refresh: () => void;
21
+ };
22
+ type GetResourcesOptions<T> = {
23
+ transformData?: (input: any) => T;
23
24
  };
24
25
  export {};
@@ -1,6 +1,5 @@
1
1
  import { getContext, setContext } from 'svelte';
2
2
  function createAPIProxy() {
3
- // Use explicit type instead of ReturnType
4
3
  const resources = $state(new Map());
5
4
  function getRessource(url, options) {
6
5
  // Check if we already have this resource
@@ -66,7 +65,10 @@ function createAPIProxy() {
66
65
  }
67
66
  return {
68
67
  getRessource,
69
- invalidateAll
68
+ invalidateAll,
69
+ get urls() {
70
+ return Array.from(resources.entries()).map(([url, resource]) => url);
71
+ }
70
72
  };
71
73
  }
72
74
  export function setAPIProxyContext(key = API_PROXY.ROOT) {
@@ -76,9 +78,8 @@ export function setAPIProxyContext(key = API_PROXY.ROOT) {
76
78
  export function getAPIProxyContext(key = API_PROXY.ROOT) {
77
79
  return getContext(key);
78
80
  }
79
- // @TODO why multiple APIProxy ROOT everywhere should work
81
+ // @TODO why multiple APIProxy... ROOT everywhere should work
80
82
  export const API_PROXY = {
81
83
  DOCUMENT: Symbol('api-proxy.document'),
82
- ROOT: Symbol('api-proxy.root'),
83
- TIPTAP: Symbol('api-proxy.tiptap')
84
+ ROOT: Symbol('api-proxy.root')
84
85
  };
@@ -34,7 +34,6 @@
34
34
  if (error && error.message) {
35
35
  toast.error(error.message);
36
36
  }
37
- console.log(data);
38
37
  if (data && data.status) {
39
38
  success = data.status;
40
39
  }
@@ -52,8 +51,13 @@
52
51
  {/if}
53
52
  </AuthForm>
54
53
 
55
- <style>
56
- p {
54
+ <style>/**************************************/
55
+
56
+ /* Font */
57
+
58
+ /**************************************/
59
+
60
+ p {
57
61
  font-size: var(--rz-text-lg);
58
62
  font-variation-settings: 'wght' 600;
59
63
  font-weight: 600;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimecms",
3
- "version": "0.26.6",
3
+ "version": "0.26.7",
4
4
  "homepage": "https://github.com/bienbiendev/rime",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -140,7 +140,7 @@
140
140
  "devDependencies": {
141
141
  "@eslint/compat": "^1.2.5",
142
142
  "@eslint/js": "^9.18.0",
143
- "@sveltejs/adapter-node": "^5.2.12",
143
+ "@sveltejs/adapter-node": "^5.5.4",
144
144
  "@sveltejs/kit": "^2.57.1",
145
145
  "@sveltejs/package": "^2.3.10",
146
146
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
@@ -154,7 +154,7 @@
154
154
  "@types/sanitize-html": "^2.16.0",
155
155
  "@types/sortablejs": "^1.15.8",
156
156
  "@types/to-snake-case": "^1.0.2",
157
- "drizzle-kit": "^0.31.5",
157
+ "drizzle-kit": "^0.31.10",
158
158
  "eslint": "^9.18.0",
159
159
  "eslint-config-prettier": "^10.0.1",
160
160
  "eslint-plugin-svelte": "^3.0.0",
@@ -213,11 +213,11 @@
213
213
  "deep-object-diff": "^1.1.9",
214
214
  "deepmerge": "^4.3.1",
215
215
  "dotenv": "^16.4.7",
216
- "drizzle-orm": "^0.44.2",
216
+ "drizzle-orm": "^0.44.7",
217
217
  "flat": "^6.0.1",
218
218
  "js-cookie": "^3.0.5",
219
219
  "magic-string-ast": "^1.0.2",
220
- "nodemailer": "^6.10.0",
220
+ "nodemailer": "^8.0.5",
221
221
  "paneforge": "^0.0.6",
222
222
  "polka": "^0.5.2",
223
223
  "qs": "^6.14.0",