@yoamigo.com/core 0.1.0 → 0.1.1

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.css CHANGED
@@ -1,3 +1,230 @@
1
+ /* src/components/ya-text.css */
2
+ .ya-text-editable {
3
+ cursor: text;
4
+ transition: outline 0.15s ease;
5
+ }
6
+ .ya-text-editable:hover {
7
+ outline: 2px dashed var(--color-primary, #D4A574);
8
+ outline-offset: 4px;
9
+ border-radius: 4px;
10
+ }
11
+ body.builder-selector-active .ya-text-editable:hover {
12
+ outline: none;
13
+ cursor: inherit;
14
+ }
15
+ .ya-text-editing {
16
+ outline: 2px solid var(--color-primary, #D4A574);
17
+ outline-offset: 4px;
18
+ border-radius: 4px;
19
+ position: relative;
20
+ }
21
+ .ya-bubble-menu {
22
+ display: flex;
23
+ gap: 4px;
24
+ padding: 6px 8px;
25
+ background: #1a1a1a;
26
+ border-radius: 8px;
27
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
28
+ animation: ya-bubble-fade-in 0.15s ease;
29
+ font-family:
30
+ system-ui,
31
+ -apple-system,
32
+ BlinkMacSystemFont,
33
+ "Segoe UI",
34
+ sans-serif;
35
+ }
36
+ @keyframes ya-bubble-fade-in {
37
+ from {
38
+ opacity: 0;
39
+ transform: translateY(4px);
40
+ }
41
+ to {
42
+ opacity: 1;
43
+ transform: translateY(0);
44
+ }
45
+ }
46
+ .ya-bubble-btn {
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
50
+ width: 32px;
51
+ height: 32px;
52
+ padding: 0;
53
+ border: none;
54
+ background: transparent;
55
+ color: #e0e0e0;
56
+ border-radius: 6px;
57
+ cursor: pointer;
58
+ transition: all 0.15s ease;
59
+ font-size: 14px;
60
+ }
61
+ .ya-bubble-btn:hover {
62
+ background: rgba(255, 255, 255, 0.1);
63
+ color: #ffffff;
64
+ }
65
+ .ya-bubble-btn.is-active {
66
+ background: var(--color-primary, #D4A574);
67
+ color: #1a1a1a;
68
+ }
69
+ .ya-bubble-btn.is-active:hover {
70
+ background: var(--color-primary, #D4A574);
71
+ filter: brightness(1.1);
72
+ }
73
+ .ya-bubble-divider {
74
+ width: 1px;
75
+ height: 20px;
76
+ background: rgba(255, 255, 255, 0.2);
77
+ margin: 6px 4px;
78
+ }
79
+ .ya-bubble-select {
80
+ appearance: none;
81
+ background: transparent;
82
+ color: #e0e0e0;
83
+ border: 1px solid rgba(255, 255, 255, 0.2);
84
+ border-radius: 6px;
85
+ padding: 6px 24px 6px 10px;
86
+ font-size: 12px;
87
+ cursor: pointer;
88
+ transition: all 0.15s ease;
89
+ min-width: 70px;
90
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
91
+ background-repeat: no-repeat;
92
+ background-position: right 6px center;
93
+ }
94
+ .ya-bubble-select:hover {
95
+ border-color: rgba(255, 255, 255, 0.4);
96
+ background-color: rgba(255, 255, 255, 0.05);
97
+ }
98
+ .ya-bubble-select:focus {
99
+ outline: none;
100
+ border-color: var(--color-primary, #D4A574);
101
+ }
102
+ .ya-bubble-select option {
103
+ background: #1a1a1a;
104
+ color: #e0e0e0;
105
+ padding: 8px;
106
+ }
107
+ .ProseMirror {
108
+ outline: none;
109
+ }
110
+ .ProseMirror p {
111
+ margin: 0;
112
+ }
113
+ .ProseMirror a {
114
+ color: var(--color-primary, #D4A574);
115
+ text-decoration: underline;
116
+ }
117
+ .ProseMirror a:hover {
118
+ color: var(--color-secondary, #5C4033);
119
+ }
120
+ .ProseMirror ::selection {
121
+ background: rgba(212, 165, 116, 0.3);
122
+ }
123
+ .ProseMirror p.is-editor-empty:first-child::before {
124
+ content: attr(data-placeholder);
125
+ float: left;
126
+ color: #adb5bd;
127
+ pointer-events: none;
128
+ height: 0;
129
+ }
130
+ .ya-text-actions {
131
+ display: flex;
132
+ gap: 8px;
133
+ position: absolute;
134
+ bottom: -48px;
135
+ right: 0;
136
+ z-index: 10;
137
+ background: rgba(26, 26, 26, 0.8);
138
+ padding: 8px 10px;
139
+ border-radius: 8px;
140
+ font-family:
141
+ system-ui,
142
+ -apple-system,
143
+ BlinkMacSystemFont,
144
+ "Segoe UI",
145
+ sans-serif;
146
+ }
147
+ .ya-text-btn {
148
+ padding: 6px 14px;
149
+ font-size: 12px;
150
+ font-weight: 500;
151
+ border-radius: 6px;
152
+ cursor: pointer;
153
+ transition: all 0.15s ease;
154
+ border: none;
155
+ }
156
+ .ya-text-btn-cancel {
157
+ background: #333333;
158
+ color: #ffffff;
159
+ border: 1px solid #555555;
160
+ }
161
+ .ya-text-btn-cancel:hover {
162
+ background: #444444;
163
+ color: #ffffff;
164
+ border-color: #666666;
165
+ }
166
+ .ya-text-btn-save {
167
+ background: #D4A574;
168
+ color: #1a1a1a;
169
+ }
170
+ .ya-text-btn-save:hover {
171
+ background: #c4956a;
172
+ }
173
+ .ya-link-popover {
174
+ position: fixed;
175
+ z-index: 9999;
176
+ display: flex;
177
+ align-items: center;
178
+ gap: 6px;
179
+ padding: 8px 12px;
180
+ background: #1a1a1a;
181
+ color: #e0e0e0;
182
+ border-radius: 8px;
183
+ font-size: 13px;
184
+ font-weight: 500;
185
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
186
+ cursor: pointer;
187
+ white-space: nowrap;
188
+ transform: translateX(-50%);
189
+ pointer-events: auto;
190
+ animation: ya-link-popover-fade-in 0.1s ease;
191
+ }
192
+ .ya-link-popover:hover {
193
+ background: #2a2a2a;
194
+ }
195
+ @keyframes ya-link-popover-fade-in {
196
+ from {
197
+ opacity: 0;
198
+ transform: translateX(-50%) translateY(-4px);
199
+ }
200
+ to {
201
+ opacity: 1;
202
+ transform: translateX(-50%) translateY(0);
203
+ }
204
+ }
205
+ .ya-link-popover::before {
206
+ content: "";
207
+ position: absolute;
208
+ top: -6px;
209
+ left: 50%;
210
+ transform: translateX(-50%);
211
+ border-left: 6px solid transparent;
212
+ border-right: 6px solid transparent;
213
+ border-bottom: 6px solid #1a1a1a;
214
+ }
215
+ .ya-link-popover-icon {
216
+ width: 14px;
217
+ height: 14px;
218
+ opacity: 0.8;
219
+ flex-shrink: 0;
220
+ }
221
+ .ya-link-popover-prefix {
222
+ opacity: 0.7;
223
+ }
224
+ .ya-link-popover-name {
225
+ color: var(--color-primary, #D4A574);
226
+ }
227
+
1
228
  /* src/components/ya-tooltip.css */
2
229
  .ya-tooltip {
3
230
  position: fixed;
@@ -86,6 +313,122 @@
86
313
  border-left-color: #1a1a1a;
87
314
  }
88
315
 
316
+ /* src/components/ya-image.css */
317
+ .ya-image-container {
318
+ position: relative;
319
+ display: inline-block;
320
+ min-width: 45px;
321
+ min-height: 45px;
322
+ cursor: pointer;
323
+ transition: outline 0.15s ease;
324
+ }
325
+ .ya-image-container img {
326
+ display: block;
327
+ }
328
+ .ya-image-editable {
329
+ cursor: pointer;
330
+ }
331
+ .ya-image-editable:hover {
332
+ outline: 2px dashed var(--color-primary, #D4A574);
333
+ outline-offset: 4px;
334
+ }
335
+ .ya-image-selected {
336
+ outline: 3px solid var(--color-primary, #D4A574);
337
+ outline-offset: 4px;
338
+ }
339
+ .ya-image-overlay {
340
+ position: absolute;
341
+ inset: 0;
342
+ display: flex;
343
+ flex-direction: column;
344
+ align-items: center;
345
+ justify-content: center;
346
+ gap: 8px;
347
+ background: rgba(0, 0, 0, 0.5);
348
+ opacity: 0;
349
+ transition: opacity 0.2s ease;
350
+ pointer-events: none;
351
+ border-radius: inherit;
352
+ }
353
+ .ya-image-editable:hover .ya-image-overlay {
354
+ opacity: 1;
355
+ }
356
+ .ya-image-selected .ya-image-overlay {
357
+ opacity: 0;
358
+ }
359
+ .ya-image-edit-icon {
360
+ display: flex;
361
+ align-items: center;
362
+ justify-content: center;
363
+ width: 48px;
364
+ height: 48px;
365
+ background: white;
366
+ border-radius: 50%;
367
+ color: #1a1a1a;
368
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
369
+ }
370
+ .ya-image-edit-icon svg {
371
+ width: 24px;
372
+ height: 24px;
373
+ }
374
+ .ya-image-edit-label {
375
+ color: white;
376
+ font-size: 14px;
377
+ font-weight: 500;
378
+ text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
379
+ }
380
+ @keyframes ya-image-success {
381
+ 0% {
382
+ outline-color: var(--color-primary, #D4A574);
383
+ }
384
+ 50% {
385
+ outline-color: #22c55e;
386
+ outline-width: 4px;
387
+ }
388
+ 100% {
389
+ outline-color: var(--color-primary, #D4A574);
390
+ outline-width: 2px;
391
+ }
392
+ }
393
+ .ya-image-success {
394
+ animation: ya-image-success 0.4s ease;
395
+ }
396
+ .ya-image-loading::after {
397
+ content: "";
398
+ position: absolute;
399
+ inset: 0;
400
+ background:
401
+ linear-gradient(
402
+ 90deg,
403
+ rgba(255, 255, 255, 0) 0%,
404
+ rgba(255, 255, 255, 0.3) 50%,
405
+ rgba(255, 255, 255, 0) 100%);
406
+ background-size: 200% 100%;
407
+ animation: ya-image-shimmer 1.5s infinite;
408
+ }
409
+ @keyframes ya-image-shimmer {
410
+ 0% {
411
+ background-position: -200% 0;
412
+ }
413
+ 100% {
414
+ background-position: 200% 0;
415
+ }
416
+ }
417
+ .ya-image-container:focus {
418
+ outline: 3px solid var(--color-primary, #D4A574);
419
+ outline-offset: 4px;
420
+ }
421
+ .ya-image-container:focus:not(:focus-visible) {
422
+ outline: none;
423
+ }
424
+ .ya-image-container:focus-visible {
425
+ outline: 3px solid var(--color-primary, #D4A574);
426
+ outline-offset: 4px;
427
+ }
428
+ .ya-image-small .ya-image-overlay {
429
+ display: none;
430
+ }
431
+
89
432
  /* src/components/ya-link.css */
90
433
  .ya-link-wrapper {
91
434
  position: relative;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { ReactNode } from 'react';
3
3
  export { C as ContentStoreProviderProd, d as MarkdownText, e as MarkdownTextProps, P as PageInfo, b as StaticImage, c as StaticImageProps, M as StaticText, S as StaticTextProps, Y as YaLink, f as YaLinkProps, u as useContentStoreProd } from './MarkdownText-mylt-QX-.js';
4
4
  export { Link, LinkProps, NavigateFunction, Router, RouterProps, useNavigate } from './router.js';
5
+ export { Route, Switch } from 'wouter';
5
6
  export { A as AssetResolverFn, C as ContentRegistry, c as contentRegistry, a as getAllContent, g as getContent, h as hasContent, r as registerContent, b as resolveAssetUrl, s as setAssetResolver } from './asset-resolver-BnIvDkVv.js';
6
7
  export { i as initBuilderSelection } from './builder-selection-CYP91nRu.js';
7
8
 
@@ -60,16 +61,6 @@ declare module '@tiptap/core' {
60
61
  }
61
62
  declare function YaText({ fieldId, className, as: Component, children }: YaTextProps): react_jsx_runtime.JSX.Element;
62
63
 
63
- /**
64
- * YaImage Component - Inline image editing
65
- *
66
- * Features:
67
- * - Read mode: Renders image statically
68
- * - Edit mode: Click to open image editor panel in parent
69
- * - Supports: objectFit, objectPosition, focalPoint
70
- * - Stores content as JSON in content.json
71
- * - Protected from AI structural changes (data-ya-restricted="true")
72
- */
73
64
  interface ImageFieldValue {
74
65
  src: string;
75
66
  alt?: string;
package/dist/index.js CHANGED
@@ -2006,6 +2006,9 @@ function Router({ children, base }) {
2006
2006
  return /* @__PURE__ */ jsx12(WouterRouter, { base: basename, children });
2007
2007
  }
2008
2008
 
2009
+ // src/router/index.ts
2010
+ import { Route, Switch } from "wouter";
2011
+
2009
2012
  // src/lib/builder-selection.ts
2010
2013
  var SELECTABLE_SELECTORS = [
2011
2014
  // Interactive elements
@@ -2557,10 +2560,12 @@ export {
2557
2560
  ContentStoreProvider2 as ContentStoreProviderProd,
2558
2561
  Link2 as Link,
2559
2562
  MarkdownText,
2563
+ Route,
2560
2564
  Router,
2561
2565
  SafeHtml,
2562
2566
  MpImage as StaticImage,
2563
2567
  MpText as StaticText,
2568
+ Switch,
2564
2569
  YaImage,
2565
2570
  YaLink,
2566
2571
  YaText,
package/dist/plugin.js CHANGED
@@ -63,7 +63,9 @@ function yoamigoPlugin(options = {}) {
63
63
  // This ensures HMR WebSocket connects to the proxy (router) not directly to Vite
64
64
  clientPort: void 0,
65
65
  host: void 0,
66
- protocol: void 0
66
+ protocol: void 0,
67
+ // Hide error overlay from end users in the builder
68
+ overlay: false
67
69
  }
68
70
  },
69
71
  // Dynamic base URL for different deployment contexts:
package/dist/router.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, MouseEvent } from 'react';
3
+ export { Route, Switch } from 'wouter';
3
4
 
4
5
  /**
5
6
  * Router Abstraction - Shared Types
package/dist/router.js CHANGED
@@ -35,8 +35,13 @@ function Router({ children, base }) {
35
35
  const basename = base ?? detectBasename();
36
36
  return /* @__PURE__ */ jsx2(WouterRouter, { base: basename, children });
37
37
  }
38
+
39
+ // src/router/index.ts
40
+ import { Route, Switch } from "wouter";
38
41
  export {
39
42
  Link,
43
+ Route,
40
44
  Router,
45
+ Switch,
41
46
  useNavigate
42
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoamigo.com/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Core components, router, and utilities for YoAmigo templates",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -31,12 +31,10 @@
31
31
  "types": "./dist/lib-prod.d.ts",
32
32
  "import": "./dist/lib-prod.js"
33
33
  },
34
- "./styles": "./src/styles/index.css",
35
- "./styles/*": "./src/styles/*"
34
+ "./styles.css": "./dist/index.css"
36
35
  },
37
36
  "files": [
38
37
  "dist",
39
- "src/styles",
40
38
  "LICENSE",
41
39
  "README.md"
42
40
  ],
@@ -69,7 +67,8 @@
69
67
  "dev": "tsup --watch",
70
68
  "typecheck": "tsc --noEmit",
71
69
  "lint": "eslint src --ext .ts,.tsx",
72
- "lint:check": "eslint src --ext .ts,.tsx"
70
+ "lint:check": "eslint src --ext .ts,.tsx",
71
+ "prepublishOnly": "pnpm build"
73
72
  },
74
73
  "dependencies": {
75
74
  "clsx": "^2.1.1",
@@ -1,5 +0,0 @@
1
- /* @yoamigo/core styles - import all component styles */
2
- @import '../components/ya-text.css';
3
- @import '../components/ya-image.css';
4
- @import '../components/ya-link.css';
5
- @import '../components/ya-tooltip.css';