@crtobiasdelsud/portal-ui 1.0.0 → 1.0.2

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 CHANGED
@@ -1,4 +1,4 @@
1
- # @crtobias/portal-ui
1
+ # @crtobiasdelsud/portal-ui
2
2
 
3
3
  Librería de componentes compartida entre el portal público (Next 15) y el
4
4
  editor CMS (Vite). Provee:
@@ -35,7 +35,7 @@ editor CMS (Vite). Provee:
35
35
  ## Instalación
36
36
 
37
37
  ```bash
38
- npm install @crtobias/portal-ui
38
+ npm install @crtobiasdelsud/portal-ui
39
39
  ```
40
40
 
41
41
  `peerDependencies`:
@@ -47,7 +47,7 @@ npm install @crtobias/portal-ui
47
47
 
48
48
  ```js
49
49
  const nextConfig = {
50
- transpilePackages: ['@crtobias/portal-ui'],
50
+ transpilePackages: ['@crtobiasdelsud/portal-ui'],
51
51
  // ...
52
52
  }
53
53
  ```
@@ -65,7 +65,7 @@ const nextConfig = {
65
65
  'use client'
66
66
  import Image from 'next/image'
67
67
  import Link from 'next/link'
68
- import { AdaptersProvider } from '@crtobias/portal-ui'
68
+ import { AdaptersProvider } from '@crtobiasdelsud/portal-ui'
69
69
  import { clientFetch } from '@/lib/clientFetch' // tu fetcher con BASE_URL + tenant
70
70
 
71
71
  export default function PortalUIProviders({ children }) {
@@ -80,7 +80,7 @@ export default function PortalUIProviders({ children }) {
80
80
  ```jsx
81
81
  // src/app/layout.jsx (server component)
82
82
  import PortalUIProviders from './PortalUIProviders'
83
- import { SiteConfigProvider } from '@crtobias/portal-ui'
83
+ import { SiteConfigProvider } from '@crtobiasdelsud/portal-ui'
84
84
 
85
85
  export default async function RootLayout({ children }) {
86
86
  const siteData = await fetchSiteConfig() // tu lógica
@@ -102,7 +102,7 @@ export default async function RootLayout({ children }) {
102
102
 
103
103
  ```jsx
104
104
  // src/PortalUIProviders.jsx
105
- import { AdaptersProvider } from '@crtobias/portal-ui'
105
+ import { AdaptersProvider } from '@crtobiasdelsud/portal-ui'
106
106
  import ImageShim from './shims/Image' // <img> plano
107
107
  import LinkShim from './shims/Link' // <a> plano
108
108
  import { backendFetch } from './lib/backendClient'
@@ -318,10 +318,10 @@ demás (componentes, hooks, styles) es código portable.
318
318
  En el `package.json` de cada app:
319
319
 
320
320
  ```json
321
- "@crtobias/portal-ui": "file:../portal-ui"
321
+ "@crtobiasdelsud/portal-ui": "file:../portal-ui"
322
322
  ```
323
323
 
324
- `npm install` crea un symlink: `node_modules/@crtobias/portal-ui` → `../portal-ui/`. **Cualquier cambio en `portal-ui/src/` aparece al toque** en las apps con HMR. **No tenés que publicar nada.**
324
+ `npm install` crea un symlink: `node_modules/@crtobiasdelsud/portal-ui` → `../portal-ui/`. **Cualquier cambio en `portal-ui/src/` aparece al toque** en las apps con HMR. **No tenés que publicar nada.**
325
325
 
326
326
  Cuando hagas un cambio que rompa, ambas apps lo ven en el siguiente reload. Cuando estás contento, lo publicás.
327
327
 
@@ -337,20 +337,20 @@ Mismo efecto que `file:`, pero global a tu máquina:
337
337
  ```bash
338
338
  cd portal-ui && npm link
339
339
 
340
- cd ../editor-template-front && npm link @crtobias/portal-ui
341
- cd ../cms-editor-front && npm link @crtobias/portal-ui
340
+ cd ../editor-template-front && npm link @crtobiasdelsud/portal-ui
341
+ cd ../cms-editor-front && npm link @crtobiasdelsud/portal-ui
342
342
  ```
343
343
 
344
344
  Para desconectar:
345
345
 
346
346
  ```bash
347
- cd editor-template-front && npm unlink @crtobias/portal-ui && npm install
347
+ cd editor-template-front && npm unlink @crtobiasdelsud/portal-ui && npm install
348
348
  ```
349
349
 
350
350
  #### C. Versión publicada (producción / otro dev sin acceso al disco)
351
351
 
352
352
  ```json
353
- "@crtobias/portal-ui": "^1.0.0"
353
+ "@crtobiasdelsud/portal-ui": "^1.0.0"
354
354
  ```
355
355
 
356
356
  ```bash
@@ -465,7 +465,7 @@ export default function NewsletterView({ subscribers, onSubmit }) {
465
465
  ```jsx
466
466
  // editor-template-front/src/components/Newsletter/Newsletter.jsx (data layer)
467
467
  import { backendFetch } from '@/lib/backendClient'
468
- import { NewsletterView } from '@crtobias/portal-ui'
468
+ import { NewsletterView } from '@crtobiasdelsud/portal-ui'
469
469
 
470
470
  export default async function Newsletter({ settings }) {
471
471
  const subs = await fetchSubscribers(backendFetch)
@@ -477,7 +477,7 @@ export default async function Newsletter({ settings }) {
477
477
  // cms-editor-front/src/previewHome/components/Newsletter/Newsletter.jsx (data layer)
478
478
  import { useEffect, useState } from 'react'
479
479
  import { backendFetch } from '@/lib/backendClient'
480
- import { NewsletterView } from '@crtobias/portal-ui'
480
+ import { NewsletterView } from '@crtobiasdelsud/portal-ui'
481
481
 
482
482
  export default function Newsletter({ settings }) {
483
483
  const [subs, setSubs] = useState([])
@@ -506,7 +506,7 @@ path con un re-export:
506
506
  ```jsx
507
507
  // editor-template-front/src/components/Newsletter/Newsletter.jsx
508
508
  'use client'
509
- export { Newsletter as default } from '@crtobias/portal-ui'
509
+ export { Newsletter as default } from '@crtobiasdelsud/portal-ui'
510
510
  ```
511
511
 
512
512
  Así no hay que tocar 20 callers — el caller sigue importando como antes, pero
@@ -535,8 +535,8 @@ git push --follow-tags
535
535
  ### 8. En las apps, traer la versión nueva
536
536
 
537
537
  ```bash
538
- cd ~/Desktop/editor-template-front && npm install @crtobias/portal-ui@latest
539
- cd ~/Desktop/cms-editor-front && npm install @crtobias/portal-ui@latest
538
+ cd ~/Desktop/editor-template-front && npm install @crtobiasdelsud/portal-ui@latest
539
+ cd ~/Desktop/cms-editor-front && npm install @crtobiasdelsud/portal-ui@latest
540
540
  ```
541
541
 
542
542
  ---
@@ -598,8 +598,8 @@ git clone git@github.com:crtobias/cms-editor-front.git
598
598
 
599
599
  # Asegurarse que las apps usen el paquete local
600
600
  cd portal-ui && npm link
601
- cd ../editor-template-front && npm link @crtobias/portal-ui
602
- cd ../cms-editor-front && npm link @crtobias/portal-ui
601
+ cd ../editor-template-front && npm link @crtobiasdelsud/portal-ui
602
+ cd ../cms-editor-front && npm link @crtobiasdelsud/portal-ui
603
603
  ```
604
604
 
605
605
  **Para cada cambio:**
@@ -813,7 +813,7 @@ import {
813
813
  FeedView, HeroView, RecommendedView, CabezalView,
814
814
  BannerView, BannerDisplay, ClimaView,
815
815
  TextWrapView, ArticleBodyView,
816
- } from '@crtobias/portal-ui'
816
+ } from '@crtobiasdelsud/portal-ui'
817
817
  ```
818
818
 
819
819
  ---
@@ -826,4 +826,4 @@ import {
826
826
  cambio de shape, cambio de signature de hook)
827
827
 
828
828
  Pinear con `^` para auto-update minor/patch en las apps. Para producción
829
- estable, pinear exact (`"@crtobias/portal-ui": "1.1.2"`).
829
+ estable, pinear exact (`"@crtobiasdelsud/portal-ui": "1.1.2"`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crtobiasdelsud/portal-ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Componentes compartidos entre el portal (Next) y el CMS (Vite) — widgets, views, providers para adapters y article pool.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -1,18 +1,18 @@
1
- import style from "./BlockMain.module.scss"
2
- import WidgetErrorBoundary from "../WidgetErrorBoundary"
3
-
4
- export default function BlockMain({ widgets, registry }) {
5
- const widget = widgets?.[0]
6
- if (!widget) return null
7
-
8
- const Widget = registry[widget.type]
9
- if (!Widget) return null
10
-
11
- return (
12
- <section className={style.container}>
13
- <WidgetErrorBoundary>
14
- <Widget settings={widget.settings} />
15
- </WidgetErrorBoundary>
16
- </section>
17
- )
18
- }
1
+ import style from "./BlockMain.module.scss"
2
+ import WidgetErrorBoundary from "../WidgetErrorBoundary"
3
+
4
+ export default function BlockMain({ widgets, registry }) {
5
+ const widget = widgets?.[0]
6
+ if (!widget) return null
7
+
8
+ const Widget = registry[widget.type]
9
+ if (!Widget) return null
10
+
11
+ return (
12
+ <section className={style.container}>
13
+ <WidgetErrorBoundary>
14
+ <Widget settings={widget.settings} />
15
+ </WidgetErrorBoundary>
16
+ </section>
17
+ )
18
+ }
@@ -1,9 +1,9 @@
1
-
2
-
3
- .container {
4
- border: 10px solid red;
5
- background-color: var(--surface-color, #ffffff);
6
- box-sizing: border-box;
7
- height: 100%;
8
- max-width: 1520px;
9
- }
1
+
2
+
3
+ .container {
4
+ border: 10px solid red;
5
+ background-color: var(--surface-color, #ffffff);
6
+ box-sizing: border-box;
7
+ height: 100%;
8
+ max-width: 1520px;
9
+ }