@parhelia/core 0.1.10979 → 0.1.10981
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/README.md +34 -34
- package/dist/components/ui/copy-button.js +18 -18
- package/dist/components/ui/paste-button.js +18 -18
- package/dist/editor/ai/ToolCallDisplay.js +9 -9
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +6 -6
- package/dist/editor/sidebar/SEOInfo.js +15 -15
- package/dist/tour/Tour.js +15 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# @parhelia/core
|
|
2
|
-
|
|
3
|
-
Core components and utilities for the Parhelia visual content editor for Sitecore.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @parhelia/core
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import { /* components */ } from '@parhelia/core';
|
|
15
|
-
import '@parhelia/core/styles.css';
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Features
|
|
19
|
-
|
|
20
|
-
- Visual editor components
|
|
21
|
-
- UI component library
|
|
22
|
-
- Content management utilities
|
|
23
|
-
- Agent-based AI assistance
|
|
24
|
-
- Page wizard functionality
|
|
25
|
-
- Field editing capabilities
|
|
26
|
-
|
|
27
|
-
## License
|
|
28
|
-
|
|
29
|
-
See LICENSE file for details.
|
|
30
|
-
|
|
31
|
-
## Documentation
|
|
32
|
-
|
|
33
|
-
For complete documentation, visit [https://parhelia.ai](https://parhelia.ai)
|
|
34
|
-
|
|
1
|
+
# @parhelia/core
|
|
2
|
+
|
|
3
|
+
Core components and utilities for the Parhelia visual content editor for Sitecore.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @parhelia/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { /* components */ } from '@parhelia/core';
|
|
15
|
+
import '@parhelia/core/styles.css';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- Visual editor components
|
|
21
|
+
- UI component library
|
|
22
|
+
- Content management utilities
|
|
23
|
+
- Agent-based AI assistance
|
|
24
|
+
- Page wizard functionality
|
|
25
|
+
- Field editing capabilities
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
See LICENSE file for details.
|
|
30
|
+
|
|
31
|
+
## Documentation
|
|
32
|
+
|
|
33
|
+
For complete documentation, visit [https://parhelia.ai](https://parhelia.ai)
|
|
34
|
+
|
|
@@ -12,24 +12,24 @@ export function CopyButton({ textToCopy, duration = 2000, className, children, i
|
|
|
12
12
|
return;
|
|
13
13
|
const style = document.createElement("style");
|
|
14
14
|
style.id = styleId;
|
|
15
|
-
style.textContent = `
|
|
16
|
-
@keyframes shake {
|
|
17
|
-
0%, 100% { transform: translateX(-50%) rotate(0deg); }
|
|
18
|
-
10% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
19
|
-
20% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
20
|
-
30% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
21
|
-
40% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
22
|
-
50% { transform: translateX(-50%) rotate(-1deg) scale(1.02); }
|
|
23
|
-
60% { transform: translateX(-50%) rotate(1deg) scale(1.02); }
|
|
24
|
-
70% { transform: translateX(-50%) rotate(-1deg); }
|
|
25
|
-
80% { transform: translateX(-50%) rotate(1deg); }
|
|
26
|
-
90% { transform: translateX(-50%) rotate(0deg); }
|
|
27
|
-
}
|
|
28
|
-
@keyframes fadeOut {
|
|
29
|
-
0% { opacity: 1; }
|
|
30
|
-
70% { opacity: 1; }
|
|
31
|
-
100% { opacity: 0; }
|
|
32
|
-
}
|
|
15
|
+
style.textContent = `
|
|
16
|
+
@keyframes shake {
|
|
17
|
+
0%, 100% { transform: translateX(-50%) rotate(0deg); }
|
|
18
|
+
10% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
19
|
+
20% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
20
|
+
30% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
21
|
+
40% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
22
|
+
50% { transform: translateX(-50%) rotate(-1deg) scale(1.02); }
|
|
23
|
+
60% { transform: translateX(-50%) rotate(1deg) scale(1.02); }
|
|
24
|
+
70% { transform: translateX(-50%) rotate(-1deg); }
|
|
25
|
+
80% { transform: translateX(-50%) rotate(1deg); }
|
|
26
|
+
90% { transform: translateX(-50%) rotate(0deg); }
|
|
27
|
+
}
|
|
28
|
+
@keyframes fadeOut {
|
|
29
|
+
0% { opacity: 1; }
|
|
30
|
+
70% { opacity: 1; }
|
|
31
|
+
100% { opacity: 0; }
|
|
32
|
+
}
|
|
33
33
|
`;
|
|
34
34
|
document.head.appendChild(style);
|
|
35
35
|
}, []);
|
|
@@ -13,24 +13,24 @@ export function PasteButton({ onPaste, duration = 2000, className, children, ico
|
|
|
13
13
|
return;
|
|
14
14
|
const style = document.createElement("style");
|
|
15
15
|
style.id = styleId;
|
|
16
|
-
style.textContent = `
|
|
17
|
-
@keyframes shake {
|
|
18
|
-
0%, 100% { transform: translateX(-50%) rotate(0deg); }
|
|
19
|
-
10% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
20
|
-
20% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
21
|
-
30% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
22
|
-
40% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
23
|
-
50% { transform: translateX(-50%) rotate(-1deg) scale(1.02); }
|
|
24
|
-
60% { transform: translateX(-50%) rotate(1deg) scale(1.02); }
|
|
25
|
-
70% { transform: translateX(-50%) rotate(-1deg); }
|
|
26
|
-
80% { transform: translateX(-50%) rotate(1deg); }
|
|
27
|
-
90% { transform: translateX(-50%) rotate(0deg); }
|
|
28
|
-
}
|
|
29
|
-
@keyframes fadeOut {
|
|
30
|
-
0% { opacity: 1; }
|
|
31
|
-
70% { opacity: 1; }
|
|
32
|
-
100% { opacity: 0; }
|
|
33
|
-
}
|
|
16
|
+
style.textContent = `
|
|
17
|
+
@keyframes shake {
|
|
18
|
+
0%, 100% { transform: translateX(-50%) rotate(0deg); }
|
|
19
|
+
10% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
20
|
+
20% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
21
|
+
30% { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
|
|
22
|
+
40% { transform: translateX(-50%) rotate(2deg) scale(1.1); }
|
|
23
|
+
50% { transform: translateX(-50%) rotate(-1deg) scale(1.02); }
|
|
24
|
+
60% { transform: translateX(-50%) rotate(1deg) scale(1.02); }
|
|
25
|
+
70% { transform: translateX(-50%) rotate(-1deg); }
|
|
26
|
+
80% { transform: translateX(-50%) rotate(1deg); }
|
|
27
|
+
90% { transform: translateX(-50%) rotate(0deg); }
|
|
28
|
+
}
|
|
29
|
+
@keyframes fadeOut {
|
|
30
|
+
0% { opacity: 1; }
|
|
31
|
+
70% { opacity: 1; }
|
|
32
|
+
100% { opacity: 0; }
|
|
33
|
+
}
|
|
34
34
|
`;
|
|
35
35
|
document.head.appendChild(style);
|
|
36
36
|
}, []);
|
|
@@ -18,15 +18,15 @@ const darkJsonStyles = {
|
|
|
18
18
|
undefinedValue: "dark-json-undefined",
|
|
19
19
|
};
|
|
20
20
|
// JSON view light theme CSS
|
|
21
|
-
const JsonLightThemeStyles = () => (_jsx("style", { children: `
|
|
22
|
-
.dark-json-container { color: #1f2937; }
|
|
23
|
-
.dark-json-label { color: #2563eb; font-weight: 500; }
|
|
24
|
-
.dark-json-punctuation { color: #6b7280; }
|
|
25
|
-
.dark-json-string { color: #059669; }
|
|
26
|
-
.dark-json-number { color: #d97706; }
|
|
27
|
-
.dark-json-boolean { color: #7c3aed; }
|
|
28
|
-
.dark-json-null { color: #dc2626; }
|
|
29
|
-
.dark-json-undefined { color: #dc2626; }
|
|
21
|
+
const JsonLightThemeStyles = () => (_jsx("style", { children: `
|
|
22
|
+
.dark-json-container { color: #1f2937; }
|
|
23
|
+
.dark-json-label { color: #2563eb; font-weight: 500; }
|
|
24
|
+
.dark-json-punctuation { color: #6b7280; }
|
|
25
|
+
.dark-json-string { color: #059669; }
|
|
26
|
+
.dark-json-number { color: #d97706; }
|
|
27
|
+
.dark-json-boolean { color: #7c3aed; }
|
|
28
|
+
.dark-json-null { color: #dc2626; }
|
|
29
|
+
.dark-json-undefined { color: #dc2626; }
|
|
30
30
|
` }));
|
|
31
31
|
import { FileText, Search, Code, FolderOpen, FileSearch, Trash2, Globe, Brain, CheckSquare, Edit, FileEdit, Wrench, ChevronDown, ChevronRight, } from "lucide-react";
|
|
32
32
|
// Function to get the appropriate icon for each tool
|
|
@@ -263,12 +263,12 @@ export function useInlineAiCompletion({ pageViewContext, cursorSpanId, isUpdatin
|
|
|
263
263
|
}
|
|
264
264
|
// Create context-aware completion prompt
|
|
265
265
|
const systemPrompt = pageContext
|
|
266
|
-
? `You are a content completion tool for a ${pageContext.pageType} page titled "${pageContext.pageTitle}".
|
|
267
|
-
|
|
268
|
-
Page context: ${pageContext.abstract}
|
|
269
|
-
|
|
270
|
-
Field being edited: ${fieldName || fieldId}
|
|
271
|
-
|
|
266
|
+
? `You are a content completion tool for a ${pageContext.pageType} page titled "${pageContext.pageTitle}".
|
|
267
|
+
|
|
268
|
+
Page context: ${pageContext.abstract}
|
|
269
|
+
|
|
270
|
+
Field being edited: ${fieldName || fieldId}
|
|
271
|
+
|
|
272
272
|
ONLY provide the completion text (what comes after the user's text), never repeat any part of what the user wrote. Your completion should flow naturally from the user's text and be relevant to the page context and field being edited.`
|
|
273
273
|
: "You are a sentence completion tool. ONLY provide the completion text (what comes after the user's text), never repeat any part of what the user wrote. Your completion should flow naturally from the user's text.";
|
|
274
274
|
const messages = [
|
|
@@ -47,21 +47,21 @@ export function SEOInfo() {
|
|
|
47
47
|
throw new Error("AI service URL not configured");
|
|
48
48
|
}
|
|
49
49
|
// Prepare SEO optimization prompt in correct message format
|
|
50
|
-
const seoPrompt = `Analyze the current page for SEO optimization and provide specific recommendations.
|
|
51
|
-
|
|
52
|
-
Current page details:
|
|
53
|
-
- Page: ${item?.name || "Unknown"}
|
|
54
|
-
- Path: ${item?.path || "Unknown"}
|
|
55
|
-
- Title: ${currentTitle || "No title found"}
|
|
56
|
-
- Description: ${currentDescription || "No description found"}
|
|
57
|
-
|
|
58
|
-
Please analyze and provide:
|
|
59
|
-
1. Title optimization suggestions (should be 50-60 characters)
|
|
60
|
-
2. Meta description recommendations (120-155 characters)
|
|
61
|
-
3. Keyword analysis and suggestions
|
|
62
|
-
4. Content structure improvements
|
|
63
|
-
5. Overall SEO recommendations
|
|
64
|
-
|
|
50
|
+
const seoPrompt = `Analyze the current page for SEO optimization and provide specific recommendations.
|
|
51
|
+
|
|
52
|
+
Current page details:
|
|
53
|
+
- Page: ${item?.name || "Unknown"}
|
|
54
|
+
- Path: ${item?.path || "Unknown"}
|
|
55
|
+
- Title: ${currentTitle || "No title found"}
|
|
56
|
+
- Description: ${currentDescription || "No description found"}
|
|
57
|
+
|
|
58
|
+
Please analyze and provide:
|
|
59
|
+
1. Title optimization suggestions (should be 50-60 characters)
|
|
60
|
+
2. Meta description recommendations (120-155 characters)
|
|
61
|
+
3. Keyword analysis and suggestions
|
|
62
|
+
4. Content structure improvements
|
|
63
|
+
5. Overall SEO recommendations
|
|
64
|
+
|
|
65
65
|
Focus on actionable insights for improving search engine visibility.`;
|
|
66
66
|
// Format as proper message for AI service
|
|
67
67
|
const messages = [
|
package/dist/tour/Tour.js
CHANGED
|
@@ -399,21 +399,21 @@ export function Tour({ tourStopCallback }) {
|
|
|
399
399
|
if (!show) {
|
|
400
400
|
return _jsx("div", { className: "overlay", style: overlayStyle });
|
|
401
401
|
}
|
|
402
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "overlay", style: overlayStyle }), _jsxs("div", { style: { ...boxStyle, pointerEvents: passThrough ? "none" : "auto" }, className: `fade-in flex flex-col items-center text-gray-800 transition-opacity duration-200 ${bubbleVisible ? "opacity-100" : "opacity-0"}`, children: [focusRect && (_jsx("div", { className: "pointer-events-none", children: _jsx("svg", { width: "100px", height: "100px", viewBox: "0 -7.89 113.08 113.08", xmlns: "http://www.w3.org/2000/svg", className: cn("pointer-events-none", arrowRotation), style: arrowStyle, children: _jsx("path", { style: { stroke: "#0000ff", fill: "#0000ff" }, d: "M20.1871 175C15.7485 172.891 13.0008 172.469 12.1553 170.992C8.98489 165.508 5.39173 160.024 3.70083 153.908C-1.37187 137.666 -0.737781 121.214 2.64402 104.762C8.35081 76.7092 21.0325 51.8201 36.8847 28.1966C38.5756 25.6655 40.0552 23.1344 41.7461 20.3924C41.7461 20.1814 41.5347 19.7596 41.112 19.1268C36.462 20.3923 31.6007 21.6579 26.9507 22.7125C24.4144 23.1344 21.4552 23.1344 18.9189 22.2907C17.4394 21.8688 15.3258 19.5486 15.3258 18.0722C15.3258 16.1739 16.8053 13.8537 18.0735 12.1663C19.1303 11.1117 21.0326 10.9008 22.7235 10.4789C35.4052 7.31508 48.087 3.72935 60.9801 0.776411C71.9709 -1.75468 75.564 1.83105 74.9299 12.5882C74.2959 23.7672 74.0845 34.9462 73.6618 45.9142C73.4505 49.289 72.8164 52.8747 72.3936 56.6714C63.5164 52.6638 63.5164 52.6638 60.346 18.494C47.0301 33.2588 38.1529 49.289 29.9098 65.7411C21.6666 82.1932 16.1712 99.489 13.2121 117.839C10.2531 136.823 13.8462 154.751 20.1871 175Z", fill: "#0D1927" }) }) })), _jsx("style", { children: `
|
|
403
|
-
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');
|
|
404
|
-
.handwritten {
|
|
405
|
-
font-family: 'Caveat', cursive;
|
|
406
|
-
}
|
|
407
|
-
.fade-background {
|
|
408
|
-
background: radial-gradient(circle, rgba(255,255,255,0.8) 60%, rgba(255,255,255,0) 90%);
|
|
409
|
-
}
|
|
410
|
-
.fade-in {
|
|
411
|
-
animation: fadeIn 0.5s ease-in-out;
|
|
412
|
-
}
|
|
413
|
-
@keyframes fadeIn {
|
|
414
|
-
from { opacity: 0; }
|
|
415
|
-
to { opacity: 1; }
|
|
416
|
-
}
|
|
402
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "overlay", style: overlayStyle }), _jsxs("div", { style: { ...boxStyle, pointerEvents: passThrough ? "none" : "auto" }, className: `fade-in flex flex-col items-center text-gray-800 transition-opacity duration-200 ${bubbleVisible ? "opacity-100" : "opacity-0"}`, children: [focusRect && (_jsx("div", { className: "pointer-events-none", children: _jsx("svg", { width: "100px", height: "100px", viewBox: "0 -7.89 113.08 113.08", xmlns: "http://www.w3.org/2000/svg", className: cn("pointer-events-none", arrowRotation), style: arrowStyle, children: _jsx("path", { style: { stroke: "#0000ff", fill: "#0000ff" }, d: "M20.1871 175C15.7485 172.891 13.0008 172.469 12.1553 170.992C8.98489 165.508 5.39173 160.024 3.70083 153.908C-1.37187 137.666 -0.737781 121.214 2.64402 104.762C8.35081 76.7092 21.0325 51.8201 36.8847 28.1966C38.5756 25.6655 40.0552 23.1344 41.7461 20.3924C41.7461 20.1814 41.5347 19.7596 41.112 19.1268C36.462 20.3923 31.6007 21.6579 26.9507 22.7125C24.4144 23.1344 21.4552 23.1344 18.9189 22.2907C17.4394 21.8688 15.3258 19.5486 15.3258 18.0722C15.3258 16.1739 16.8053 13.8537 18.0735 12.1663C19.1303 11.1117 21.0326 10.9008 22.7235 10.4789C35.4052 7.31508 48.087 3.72935 60.9801 0.776411C71.9709 -1.75468 75.564 1.83105 74.9299 12.5882C74.2959 23.7672 74.0845 34.9462 73.6618 45.9142C73.4505 49.289 72.8164 52.8747 72.3936 56.6714C63.5164 52.6638 63.5164 52.6638 60.346 18.494C47.0301 33.2588 38.1529 49.289 29.9098 65.7411C21.6666 82.1932 16.1712 99.489 13.2121 117.839C10.2531 136.823 13.8462 154.751 20.1871 175Z", fill: "#0D1927" }) }) })), _jsx("style", { children: `
|
|
403
|
+
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');
|
|
404
|
+
.handwritten {
|
|
405
|
+
font-family: 'Caveat', cursive;
|
|
406
|
+
}
|
|
407
|
+
.fade-background {
|
|
408
|
+
background: radial-gradient(circle, rgba(255,255,255,0.8) 60%, rgba(255,255,255,0) 90%);
|
|
409
|
+
}
|
|
410
|
+
.fade-in {
|
|
411
|
+
animation: fadeIn 0.5s ease-in-out;
|
|
412
|
+
}
|
|
413
|
+
@keyframes fadeIn {
|
|
414
|
+
from { opacity: 0; }
|
|
415
|
+
to { opacity: 1; }
|
|
416
|
+
}
|
|
417
417
|
` }), _jsxs("div", { className: `border-theme-secondary relative flex rounded-lg border bg-gray-50 shadow-2xl ${isMobile
|
|
418
418
|
? "w-[95vw] flex-col items-center gap-3 p-4"
|
|
419
419
|
: "items-stretch justify-center gap-6"}`, style: bubbleStyle, children: [_jsx("div", { className: `flex flex-col gap-2 ${isMobile
|