astro-tractstack 2.0.32 → 2.0.34
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/index.js +0 -4
- package/package.json +1 -1
- package/templates/src/components/edit/Header.tsx +7 -2
- package/templates/src/components/edit/pane/AddPanePanel_new.tsx +6 -1
- package/templates/src/pages/api/sandbox.ts +0 -6
- package/templates/src/pages/sandbox.astro +13 -1
- package/templates/src/stores/storykeep.ts +2 -0
- package/utils/inject-files.ts +0 -4
- package/templates/src/pages/storykeep/init.astro +0 -75
package/dist/index.js
CHANGED
|
@@ -839,10 +839,6 @@ async function w(t, e, c) {
|
|
|
839
839
|
src: t("../templates/src/pages/storykeep.astro"),
|
|
840
840
|
dest: "src/pages/storykeep.astro"
|
|
841
841
|
},
|
|
842
|
-
{
|
|
843
|
-
src: t("../templates/src/pages/storykeep/init.astro"),
|
|
844
|
-
dest: "src/pages/storykeep/init.astro"
|
|
845
|
-
},
|
|
846
842
|
{
|
|
847
843
|
src: t("../templates/src/pages/storykeep/content.astro"),
|
|
848
844
|
dest: "src/pages/storykeep/content.astro"
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
setViewportMode,
|
|
15
15
|
settingsPanelStore,
|
|
16
16
|
pendingHomePageSlugStore,
|
|
17
|
+
saasModalOpenStore,
|
|
17
18
|
} from '@/stores/storykeep';
|
|
18
19
|
import { getCtx, ROOT_NODE_NAME } from '@/stores/nodes';
|
|
19
20
|
import SaveModal from '@/components/edit/state/SaveModal';
|
|
@@ -48,7 +49,11 @@ const StoryKeepHeader = ({
|
|
|
48
49
|
}, [ctx.history]);
|
|
49
50
|
|
|
50
51
|
const handleSave = () => {
|
|
51
|
-
|
|
52
|
+
if (isSandboxMode) {
|
|
53
|
+
saasModalOpenStore.set(true);
|
|
54
|
+
} else {
|
|
55
|
+
setShowSaveModal(true);
|
|
56
|
+
}
|
|
52
57
|
};
|
|
53
58
|
|
|
54
59
|
const handleCloseSaveModal = () => {
|
|
@@ -167,7 +172,7 @@ const StoryKeepHeader = ({
|
|
|
167
172
|
</div>
|
|
168
173
|
)}
|
|
169
174
|
|
|
170
|
-
{shouldShowSave &&
|
|
175
|
+
{shouldShowSave && (
|
|
171
176
|
<div className="flex flex-wrap items-center justify-center gap-2 text-sm">
|
|
172
177
|
<button
|
|
173
178
|
onClick={handleSave}
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import { DirectInjectStep } from './steps/DirectInjectStep';
|
|
24
24
|
import BooleanToggle from '@/components/form/BooleanToggle';
|
|
25
25
|
import EnumSelect from '@/components/form/EnumSelect';
|
|
26
|
+
import type { StoryFragmentNode } from '@/types/compositorTypes';
|
|
26
27
|
|
|
27
28
|
type Step =
|
|
28
29
|
| 'initial'
|
|
@@ -306,8 +307,12 @@ const AddPaneNewPanel = ({
|
|
|
306
307
|
first ? 'before' : 'after'
|
|
307
308
|
);
|
|
308
309
|
});
|
|
309
|
-
|
|
310
|
+
const storyFragment = cloneDeep(
|
|
311
|
+
ctx.allNodes.get().get(ownerId)
|
|
312
|
+
) as StoryFragmentNode;
|
|
313
|
+
ctx.modifyNodes([{ ...storyFragment, isChanged: true }]);
|
|
310
314
|
}
|
|
315
|
+
ctx.notifyNode(`root`);
|
|
311
316
|
setParentMode(PaneAddMode.DEFAULT, false);
|
|
312
317
|
} catch (err) {
|
|
313
318
|
console.error('Error inserting template:', err);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from '@/types/astro';
|
|
2
2
|
|
|
3
3
|
export const POST: APIRoute = async ({ request }) => {
|
|
4
|
-
console.log(1);
|
|
5
4
|
const goBackend =
|
|
6
5
|
import.meta.env.PUBLIC_GO_BACKEND || 'http://localhost:8080';
|
|
7
6
|
const sharedSecret = import.meta.env.PRIVATE_SANDBOX_SECRET;
|
|
@@ -9,9 +8,6 @@ export const POST: APIRoute = async ({ request }) => {
|
|
|
9
8
|
request.headers.get('X-Tenant-ID') ||
|
|
10
9
|
import.meta.env.PUBLIC_TENANTID ||
|
|
11
10
|
'default';
|
|
12
|
-
console.log(goBackend);
|
|
13
|
-
console.log(sharedSecret);
|
|
14
|
-
console.log(tenantId);
|
|
15
11
|
|
|
16
12
|
if (!sharedSecret || sharedSecret === 'false' || sharedSecret === 'true') {
|
|
17
13
|
return new Response(
|
|
@@ -35,12 +31,10 @@ export const POST: APIRoute = async ({ request }) => {
|
|
|
35
31
|
{ status: 403, headers: { 'Content-Type': 'application/json' } }
|
|
36
32
|
);
|
|
37
33
|
}
|
|
38
|
-
console.log(profileCookie);
|
|
39
34
|
|
|
40
35
|
try {
|
|
41
36
|
const body = await request.json();
|
|
42
37
|
const { action, payload } = body;
|
|
43
|
-
console.log(action, payload);
|
|
44
38
|
|
|
45
39
|
if (action !== 'askLemur') {
|
|
46
40
|
return new Response(
|
|
@@ -4,7 +4,9 @@ import Layout from '@/layouts/Layout.astro';
|
|
|
4
4
|
import Header from '@/components/Header.astro';
|
|
5
5
|
import { getFullContentMap } from '@/stores/analytics';
|
|
6
6
|
import { getBrandConfig } from '@/utils/api/brandConfig';
|
|
7
|
-
import {
|
|
7
|
+
import CodeHook, {
|
|
8
|
+
components as codeHookComponents,
|
|
9
|
+
} from '@/custom/CodeHook.astro';
|
|
8
10
|
import StoryKeepHeader from '@/components/edit/Header';
|
|
9
11
|
import StoryKeepToolBar from '@/components/edit/ToolBar';
|
|
10
12
|
import StoryKeepToolMode from '@/components/edit/ToolMode';
|
|
@@ -62,6 +64,16 @@ const hasProfile = Astro.request.headers
|
|
|
62
64
|
isEditor={true}
|
|
63
65
|
>
|
|
64
66
|
<SandboxAuthWrapper client:load isServerSideAuthenticated={!!hasProfile} />
|
|
67
|
+
|
|
68
|
+
<CodeHook
|
|
69
|
+
target="get-tractstack"
|
|
70
|
+
options={{
|
|
71
|
+
params: {
|
|
72
|
+
options: JSON.stringify({ isEmbedded: false }),
|
|
73
|
+
},
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
|
|
65
77
|
<Header
|
|
66
78
|
title={title}
|
|
67
79
|
slug="sandbox"
|
package/utils/inject-files.ts
CHANGED
|
@@ -848,10 +848,6 @@ export async function injectTemplateFiles(
|
|
|
848
848
|
src: resolve('../templates/src/pages/storykeep.astro'),
|
|
849
849
|
dest: 'src/pages/storykeep.astro',
|
|
850
850
|
},
|
|
851
|
-
{
|
|
852
|
-
src: resolve('../templates/src/pages/storykeep/init.astro'),
|
|
853
|
-
dest: 'src/pages/storykeep/init.astro',
|
|
854
|
-
},
|
|
855
851
|
{
|
|
856
852
|
src: resolve('../templates/src/pages/storykeep/content.astro'),
|
|
857
853
|
dest: 'src/pages/storykeep/content.astro',
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { freshInstallStore } from '@/stores/backend';
|
|
3
|
-
import { preHealthCheck } from '@/utils/backend';
|
|
4
|
-
import RegistrationForm from '@/components/tenant/RegistrationForm';
|
|
5
|
-
|
|
6
|
-
const tenantId =
|
|
7
|
-
Astro.locals.tenant?.id || import.meta.env.PUBLIC_TENANTID || 'default';
|
|
8
|
-
await preHealthCheck(tenantId);
|
|
9
|
-
|
|
10
|
-
const { needsSetup } = freshInstallStore.get();
|
|
11
|
-
|
|
12
|
-
if (!needsSetup) {
|
|
13
|
-
return Astro.redirect('/storykeep');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const isDev = import.meta.env.DEV;
|
|
17
|
-
const isInitialized = !freshInstallStore.get().needsSetup;
|
|
18
|
-
const cssBasePath = isInitialized ? '/media/css' : '/styles';
|
|
19
|
-
const mainStylesUrl = isDev
|
|
20
|
-
? `${cssBasePath}/storykeep.css`
|
|
21
|
-
: `${cssBasePath}/frontend.css`;
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
<!doctype html>
|
|
25
|
-
<html lang="en" class="h-full bg-gray-50">
|
|
26
|
-
<head>
|
|
27
|
-
<meta charset="UTF-8" />
|
|
28
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
29
|
-
<title>Initialize TractStack</title>
|
|
30
|
-
<link rel="stylesheet" href={`${cssBasePath}/custom.css`} />
|
|
31
|
-
<link rel="stylesheet" href={mainStylesUrl} />
|
|
32
|
-
</head>
|
|
33
|
-
<body class="h-full">
|
|
34
|
-
<div class="max-w-5xl p-3.5 md:p-8">
|
|
35
|
-
<RegistrationForm client:load isInitMode={true} />
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
// Ensure clean slate for fresh installation
|
|
40
|
-
(function initCleanSlate() {
|
|
41
|
-
try {
|
|
42
|
-
// Clear admin/editor auth cookies
|
|
43
|
-
document.cookie =
|
|
44
|
-
'admin_auth=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax';
|
|
45
|
-
document.cookie =
|
|
46
|
-
'editor_auth=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax';
|
|
47
|
-
|
|
48
|
-
// Clear all TractStack localStorage items
|
|
49
|
-
const tractStackKeys = [];
|
|
50
|
-
for (let i = 0; i < localStorage.length; i++) {
|
|
51
|
-
const key = localStorage.key(i);
|
|
52
|
-
if (key && key.startsWith('tractstack_')) {
|
|
53
|
-
tractStackKeys.push(key);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
tractStackKeys.forEach((key) => localStorage.removeItem(key));
|
|
57
|
-
|
|
58
|
-
// Clear session-related items
|
|
59
|
-
localStorage.removeItem('tractstack_session_id');
|
|
60
|
-
localStorage.removeItem('tractstack_fingerprint');
|
|
61
|
-
localStorage.removeItem('tractstack_visit');
|
|
62
|
-
localStorage.removeItem('tractstack_entered_tracked');
|
|
63
|
-
|
|
64
|
-
// Clear session cookie
|
|
65
|
-
document.cookie =
|
|
66
|
-
'tractstack_session_id=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Lax';
|
|
67
|
-
|
|
68
|
-
console.log('TractStack: Clean slate initialization complete');
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.warn('TractStack: Error during clean slate init:', error);
|
|
71
|
-
}
|
|
72
|
-
})();
|
|
73
|
-
</script>
|
|
74
|
-
</body>
|
|
75
|
-
</html>
|