@portaki/module-sections 1.2.6 → 1.2.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.
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@portaki/module-sections",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "Portaki module — editorial sections (TipTap)",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./src/index.tsx",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@portaki/sdk": "^
|
|
9
|
+
"@portaki/sdk": "^3.0.0",
|
|
10
10
|
"@tiptap/core": "^3.0.0",
|
|
11
11
|
"@tiptap/html": "^3.0.0",
|
|
12
12
|
"@tiptap/starter-kit": "^3.0.0",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"react-dom": "^19.1.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@portaki/cli": "^0.
|
|
18
|
-
"@portaki/sdk-test-support": "^
|
|
17
|
+
"@portaki/cli": "^1.0.0",
|
|
18
|
+
"@portaki/sdk-test-support": "^3.0.0",
|
|
19
19
|
"@testing-library/jest-dom": "^6.6.3",
|
|
20
20
|
"@testing-library/react": "^16.3.0",
|
|
21
21
|
"@types/react": "^19",
|
package/portaki.catalog.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"fr": "Blocs de contenu riches (TipTap) pour le carnet d’accueil invité.",
|
|
10
10
|
"en": "Rich content blocks (TipTap) for the guest welcome book."
|
|
11
11
|
},
|
|
12
|
-
"version": "1.2.
|
|
12
|
+
"version": "1.2.7",
|
|
13
13
|
"releaseNotesUrl": "https://github.com/PortakiApp/portaki-modules/releases",
|
|
14
14
|
"changelog": [
|
|
15
15
|
{
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"sections"
|
|
43
43
|
],
|
|
44
44
|
"portakiVersionMin": "1.0.0",
|
|
45
|
-
"requiresHostSdk": "
|
|
45
|
+
"requiresHostSdk": "3.0.0",
|
|
46
46
|
"database": {
|
|
47
47
|
"schemaVersion": "1.0.1"
|
|
48
48
|
},
|
|
@@ -122,6 +122,6 @@
|
|
|
122
122
|
},
|
|
123
123
|
"artifacts": {
|
|
124
124
|
"wasmUrl": "oci://ghcr.io/portakiapp/portaki-module-sections",
|
|
125
|
-
"guestEsmUrl": "https://esm.sh/@portaki/module-sections@1.2.
|
|
125
|
+
"guestEsmUrl": "https://esm.sh/@portaki/module-sections@1.2.7"
|
|
126
126
|
}
|
|
127
127
|
}
|
package/portaki.module.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"fr": "Blocs de contenu riches (TipTap) pour le carnet d’accueil invité.",
|
|
10
10
|
"en": "Rich content blocks (TipTap) for the guest welcome book."
|
|
11
11
|
},
|
|
12
|
-
"version": "1.2.
|
|
12
|
+
"version": "1.2.7",
|
|
13
13
|
"releaseNotesUrl": "https://github.com/PortakiApp/portaki-modules/releases",
|
|
14
14
|
"changelog": [
|
|
15
15
|
{
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"sections"
|
|
43
43
|
],
|
|
44
44
|
"portakiVersionMin": "1.0.0",
|
|
45
|
-
"requiresHostSdk": "
|
|
45
|
+
"requiresHostSdk": "3.0.0",
|
|
46
46
|
"database": {
|
|
47
47
|
"schemaVersion": "1.0.1"
|
|
48
48
|
},
|
|
@@ -122,6 +122,6 @@
|
|
|
122
122
|
},
|
|
123
123
|
"artifacts": {
|
|
124
124
|
"wasmUrl": "oci://ghcr.io/portakiapp/portaki-module-sections",
|
|
125
|
-
"guestEsmUrl": "https://esm.sh/@portaki/module-sections@1.2.
|
|
125
|
+
"guestEsmUrl": "https://esm.sh/@portaki/module-sections@1.2.7"
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
jsonb,
|
|
6
6
|
moduleSchema,
|
|
7
7
|
table,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
workspaceId,
|
|
9
|
+
workspacePropertyIndex,
|
|
10
10
|
text,
|
|
11
11
|
timestamptz,
|
|
12
12
|
uuid,
|
|
@@ -21,7 +21,7 @@ const sectionsSchema = moduleSchema([
|
|
|
21
21
|
columns: [
|
|
22
22
|
uuidPrimaryKey(),
|
|
23
23
|
uuid('propertyId'),
|
|
24
|
-
|
|
24
|
+
workspaceId(),
|
|
25
25
|
int('sortOrder', { defaultSql: '0' }),
|
|
26
26
|
text('titleFr', { defaultSql: "''" }),
|
|
27
27
|
text('titleEn', { defaultSql: "''" }),
|
|
@@ -30,7 +30,7 @@ const sectionsSchema = moduleSchema([
|
|
|
30
30
|
timestamptz('createdAt', { nullable: false, defaultSql: 'now()' }),
|
|
31
31
|
timestamptz('updatedAt', { nullable: false, defaultSql: 'now()' }),
|
|
32
32
|
],
|
|
33
|
-
indexes: [
|
|
33
|
+
indexes: [workspacePropertyIndex()],
|
|
34
34
|
}),
|
|
35
35
|
])
|
|
36
36
|
|
|
@@ -77,7 +77,7 @@ export function defineSectionsModule(render: (ctx: ModuleContext) => ReactNode):
|
|
|
77
77
|
async handler(ctx) {
|
|
78
78
|
const rows = await ctx.db
|
|
79
79
|
.from('items')
|
|
80
|
-
.where({
|
|
80
|
+
.where({ workspaceId: ctx.workspaceId, propertyId: ctx.propertyId })
|
|
81
81
|
.many()
|
|
82
82
|
rows.sort((a, b) => {
|
|
83
83
|
const orderA = Number(a.sortOrder ?? 0)
|
|
@@ -116,7 +116,7 @@ export function defineSectionsModule(render: (ctx: ModuleContext) => ReactNode):
|
|
|
116
116
|
en: 'Create or update a section.',
|
|
117
117
|
},
|
|
118
118
|
async handler(ctx, params) {
|
|
119
|
-
const filters = {
|
|
119
|
+
const filters = { workspaceId: ctx.workspaceId, propertyId: ctx.propertyId }
|
|
120
120
|
const idRaw = stringParam(params, 'id')
|
|
121
121
|
const id =
|
|
122
122
|
idRaw == null || idRaw.trim() === '' ? crypto.randomUUID() : idRaw.trim()
|
|
@@ -181,7 +181,7 @@ export function defineSectionsModule(render: (ctx: ModuleContext) => ReactNode):
|
|
|
181
181
|
.from('items')
|
|
182
182
|
.where({
|
|
183
183
|
id: idRaw.trim(),
|
|
184
|
-
|
|
184
|
+
workspaceId: ctx.workspaceId,
|
|
185
185
|
propertyId: ctx.propertyId,
|
|
186
186
|
})
|
|
187
187
|
.delete()
|
|
@@ -201,7 +201,7 @@ export function defineSectionsModule(render: (ctx: ModuleContext) => ReactNode):
|
|
|
201
201
|
if (!Array.isArray(raw) || raw.length === 0) {
|
|
202
202
|
throw new Error('ordered_ids_required')
|
|
203
203
|
}
|
|
204
|
-
const filters = {
|
|
204
|
+
const filters = { workspaceId: ctx.workspaceId, propertyId: ctx.propertyId }
|
|
205
205
|
const now = new Date().toISOString()
|
|
206
206
|
let order = 0
|
|
207
207
|
for (const item of raw) {
|