@ozguraltan/strapi-content-input 1.0.9 → 1.0.11
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 +187 -234
- package/dist/admin/{ContentInputField-DTnK3agK.js → ContentInputField-BGJmgYGQ.js} +147 -176
- package/dist/admin/{ContentInputField-CykwdQ1S.mjs → ContentInputField-BLiKYZ7b.mjs} +147 -176
- package/dist/admin/{index-DzJ89qyO.mjs → index-DGBgjAUa.mjs} +1 -1
- package/dist/admin/{index-ysKdDQY1.js → index-DKVaYg3t.js} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/styles/swiperCss.d.ts +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,68 +1,33 @@
|
|
|
1
|
-
# @ozguraltan/strapi-
|
|
1
|
+
# @ozguraltan/strapi-content-input
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Visual Page & Content Builder (`JSONB` Custom Field) for Strapi v5**
|
|
4
4
|
|
|
5
|
-
`@ozguraltan/strapi-
|
|
5
|
+
`@ozguraltan/strapi-content-input` brings an enterprise-grade visual page and layout builder to **Strapi v5** as a native `json` (`PostgreSQL JSONB`) Custom Field (`plugin::content-input.content-input`), paired with official Vue 3 / Nuxt 3/4 storefront renderers for **Vuetify (`v3.5+` & `v4.+`)** and **Element Plus (`>=2.7.0 <4.0.0`)**.
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **Strapi Plugin Package:** `@ozguraltan/strapi-content-input`
|
|
8
8
|
- **Custom Field UID:** `plugin::content-input.content-input`
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
9
|
+
- **Database Column Type:** `json` (stored as `JSONB` in PostgreSQL)
|
|
10
|
+
- **Companion Storefront Renderers:**
|
|
11
|
+
- **Vuetify (3.5+ / 4.+):** `@ozguraltan/strapi-content-input-nuxt-vuetify` (`npx strapi-content-input-vuetify eject`)
|
|
12
|
+
- **Element Plus (2.7+ / 3.x):** `@ozguraltan/strapi-content-input-nuxt-element-plus` (`npx strapi-content-input-ep eject`)
|
|
13
|
+
- **AI Agent Technical Reference:** [AGENTS.md](./AGENTS.md)
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## İçindekiler
|
|
16
|
-
|
|
17
|
-
1. [Mevcut Bir Strapi v5 Projesine Kurulum ve Entegrasyon](#1-mevcut-bir-strapi-v5-projesine-kurulum-ve-entegrasyon)
|
|
18
|
-
2. [Görsel Kılavuz ve Ekran Görüntüleri ile Davranış Analizi](#2-görsel-kılavuz-ve-ekran-görüntüleri-ile-davranış-analizi)
|
|
19
|
-
- [2.1 Yapı Görünümü (Structure View) ve Sürükle-Bırak](#21-yapı-görünümü-structure-view-ve-sürükle-bırak)
|
|
20
|
-
- [2.2 Tuval Görünümü (Inline Canvas Preview)](#22-tuval-görünümü-inline-canvas-preview)
|
|
21
|
-
- [2.3 Tam Ekran Görsel Editör (3 Panelli Stüdyo & Ölçekleme)](#23-tam-ekran-görsel-editör-3-panelli-stüdyo--ölçekleme)
|
|
22
|
-
- [2.4 Sekme (Tab) & Akordiyon İçinde HTML Editör + İç İçe ContentInput](#24-sekme-tab--akordiyon-içinde-html-editör--iç-içe-contentinput)
|
|
23
|
-
- [2.5 Sağ Tık Bağlam Menüsü (Context Menu) & Zengin HTML Editörü](#25-sağ-tık-bağlam-menüsü-context-menu--zengin-html-editörü)
|
|
24
|
-
- [2.6 Katmanlar (Layers) Ağacı ve 5 Kırılımlı Responsive Grid Ayarları](#26-katmanlar-layers-ağacı-ve-5-kırılımlı-responsive-grid-ayarları)
|
|
25
|
-
- [2.7 YouTube Video Editörü, Özel Kapak Görseli (Thumbnail) ve Pop-up Oynatıcı](#27-youtube-video-editörü-özel-kapak-görseli-thumbnail-ve-pop-up-oynatıcı)
|
|
26
|
-
- [2.8 Hiyerarşik (Nested) Menü Oluşturucu ve Strapi Entity/Ağaç Entegrasyonu](#28-hiyerarşik-nested-menü-oluşturucu-ve-strapi-entityağaç-entegrasyonu)
|
|
27
|
-
3. [Desteklenen 13 Bileşen (Widget) Türü](#3-desteklenen-13-bileşen-widget-türü)
|
|
28
|
-
4. [Üretilen JSONB Veri Mimarisi](#4-üretilen-jsonb-veri-mimarisi)
|
|
29
|
-
5. [Lokal Geliştirme ve Playground Ortamı](#5-lokal-geliştirme-ve-playground-ortamı)
|
|
15
|
+
> 🌍 **Languages / Diller:** [English Documentation](#-english-documentation) | [Türkçe Dokümantasyon](#-türkçe-dokümantasyon)
|
|
30
16
|
|
|
31
17
|
---
|
|
32
18
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Bu eklentiyi halihazırda var olan herhangi bir **Strapi v5** projenize **3 farklı yöntemden** biriyle çekebilirsiniz. Derlenmiş `dist/` dosyaları Git deposuna dahil edildiği için doğrudan Git üzerinden kurulumda ekstra bir derleme adımına gerek kalmaz.
|
|
36
|
-
|
|
37
|
-
### Adım 1: Paketi Strapi Projenize Çekin
|
|
19
|
+
# 🇬🇧 English Documentation
|
|
38
20
|
|
|
39
|
-
|
|
21
|
+
## 1. Installation in a Strapi v5 Project
|
|
40
22
|
|
|
41
|
-
|
|
23
|
+
### Step 1: Install the Plugin
|
|
42
24
|
```bash
|
|
25
|
+
npm install @ozguraltan/strapi-content-input
|
|
26
|
+
# or directly from GitLab:
|
|
43
27
|
npm install git+ssh://git@gitlab.com:ozguraltan/strapi-content-input.git
|
|
44
|
-
# veya yarn kullanıyorsanız:
|
|
45
|
-
yarn add git+ssh://git@gitlab.com:ozguraltan/strapi-content-input.git
|
|
46
|
-
```
|
|
47
|
-
> **İpucu:** Eklentide yeni bir güncelleme yaptığınızda hedef Strapi projesinde `npm update @ozguraltan/strapi-plugin-content-input` veya aynı `npm install git+ssh://...` komutunu çalıştırmanız yeterlidir.
|
|
48
|
-
|
|
49
|
-
#### Yöntem B — Lokal Klasör Bağlantısı ile Kurulum (Aynı Bilgisayarda Geliştirme İçin)
|
|
50
|
-
```bash
|
|
51
|
-
npm install file:../strapi-content-input
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
#### Yöntem C — `.tgz` Paketi (`npm pack`) ile Kurulum
|
|
55
|
-
`strapi-content-input` dizininde `npm pack` çalıştırarak oluşan `ozguraltan-strapi-plugin-content-input-1.0.0.tgz` dosyasını hedef projede kurabilirsiniz:
|
|
56
|
-
```bash
|
|
57
|
-
npm install /path/to/ozguraltan-strapi-plugin-content-input-1.0.0.tgz
|
|
58
28
|
```
|
|
59
29
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
### Adım 2: `config/plugins.ts` (veya `config/plugins.js`) İçinde Eklentiyi Etkinleştirin
|
|
63
|
-
|
|
64
|
-
Hedef Strapi projenizin `config/plugins.ts` dosyasına `content-input` tanımını ekleyin:
|
|
65
|
-
|
|
30
|
+
### Step 2: Enable in `config/plugins.ts`
|
|
66
31
|
```ts
|
|
67
32
|
export default () => ({
|
|
68
33
|
'content-input': {
|
|
@@ -71,12 +36,8 @@ export default () => ({
|
|
|
71
36
|
});
|
|
72
37
|
```
|
|
73
38
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Adım 3: `config/middlewares.ts` İçinde Güvenlik Başlıklarını (CSP & Referrer-Policy) Yapılandırın
|
|
77
|
-
|
|
78
|
-
YouTube videolarının pop-up modal içinde sorunsuz oynatılabilmesi (`Error 153` almaması) ve harici görsellerin yüklenebilmesi için hedef projenizin `config/middlewares.ts` dosyasındaki `strapi::security` ayarını aşağıdaki gibi güncelleyin:
|
|
79
|
-
|
|
39
|
+
### Step 3: Configure Content Security Policy in `config/middlewares.ts`
|
|
40
|
+
To allow YouTube iframe embeds and external/CDN media previews inside the Strapi Admin panel:
|
|
80
41
|
```ts
|
|
81
42
|
export default [
|
|
82
43
|
'strapi::logger',
|
|
@@ -91,32 +52,10 @@ export default [
|
|
|
91
52
|
useDefaults: true,
|
|
92
53
|
directives: {
|
|
93
54
|
'connect-src': ["'self'", 'https:', 'http:'],
|
|
94
|
-
'img-src': [
|
|
95
|
-
"'self'",
|
|
96
|
-
'data:',
|
|
97
|
-
'blob:',
|
|
98
|
-
'https:',
|
|
99
|
-
'http:',
|
|
100
|
-
'https://images.unsplash.com',
|
|
101
|
-
'https://img.youtube.com',
|
|
102
|
-
'https://i.ytimg.com',
|
|
103
|
-
'https://market-assets.strapi.io',
|
|
104
|
-
],
|
|
55
|
+
'img-src': ["'self'", 'data:', 'blob:', 'https:', 'http:'],
|
|
105
56
|
'media-src': ["'self'", 'data:', 'blob:', 'https:', 'http:'],
|
|
106
|
-
'frame-src': [
|
|
107
|
-
|
|
108
|
-
'https:',
|
|
109
|
-
'http:',
|
|
110
|
-
'https://www.youtube.com',
|
|
111
|
-
'https://www.youtube-nocookie.com',
|
|
112
|
-
],
|
|
113
|
-
'child-src': [
|
|
114
|
-
"'self'",
|
|
115
|
-
'https:',
|
|
116
|
-
'http:',
|
|
117
|
-
'https://www.youtube.com',
|
|
118
|
-
'https://www.youtube-nocookie.com',
|
|
119
|
-
],
|
|
57
|
+
'frame-src': ["'self'", 'https:', 'http:', 'https://www.youtube.com', 'https://www.youtube-nocookie.com'],
|
|
58
|
+
'child-src': ["'self'", 'https:', 'http:', 'https://www.youtube.com', 'https://www.youtube-nocookie.com'],
|
|
120
59
|
upgradeInsecureRequests: null,
|
|
121
60
|
},
|
|
122
61
|
},
|
|
@@ -132,19 +71,7 @@ export default [
|
|
|
132
71
|
];
|
|
133
72
|
```
|
|
134
73
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
### Adım 4: İçerik Tipine (Content-Type) Alan Olarak Ekleyin
|
|
138
|
-
|
|
139
|
-
#### Seçenek 1 — Strapi Admin Arayüzünden (`Content-Type Builder`):
|
|
140
|
-
1. Sol menüden **Content-Type Builder** ekranına gidin.
|
|
141
|
-
2. Alan eklemek istediğiniz Collection Type veya Single Type'ı seçip **"+ Add another field"** butonuna tıklayın.
|
|
142
|
-
3. **"Custom"** sekmesine geçin ve **"Content Input (Visual Builder)"** seçeneğini seçin.
|
|
143
|
-
4. Alan adını (ör. `content` veya `body`) girip **Save** butonuna basın.
|
|
144
|
-
|
|
145
|
-
#### Seçenek 2 — `schema.json` Dosyasına Doğrudan Ekleyerek:
|
|
146
|
-
İlgili içerik tipinin `src/api/<icerik-tipi>/content-types/<icerik-tipi>/schema.json` dosyasına şu alanı ekleyin:
|
|
147
|
-
|
|
74
|
+
### Step 4: Add the Custom Field to Any Content-Type (`schema.json`)
|
|
148
75
|
```json
|
|
149
76
|
{
|
|
150
77
|
"attributes": {
|
|
@@ -160,195 +87,221 @@ export default [
|
|
|
160
87
|
}
|
|
161
88
|
```
|
|
162
89
|
|
|
163
|
-
Ardından Strapi yönetim panelini derleyip başlatın:
|
|
164
|
-
```bash
|
|
165
|
-
npm run build
|
|
166
|
-
npm run develop
|
|
167
|
-
```
|
|
168
|
-
|
|
169
90
|
---
|
|
170
91
|
|
|
171
|
-
## 2.
|
|
92
|
+
## 2. Key Features & Visual Studio Capabilities
|
|
172
93
|
|
|
173
|
-
### 2.1
|
|
94
|
+
### 2.1 Structure View, Inline Canvas View & Full-Screen 3-Panel Studio
|
|
95
|
+
- **Structure View:** Drag-and-drop rows, 12-column responsive blocks, and widgets across containers with one-click multi-column row presets (`12`, `6+6`, `4+4+4`, `3+6+3`, `8+4`).
|
|
96
|
+
- **Inline Canvas View:** Live interactive preview directly inside the Strapi Content Manager form.
|
|
97
|
+
- **Full-Screen Visual Editor:** 3-panel design studio with collapsible/resizable sidebars, 5 responsive breakpoints (`SM`, `MD`, `LG`, `XL`, `2XL`), zoom scaling (`Fit`, `50%`–`125%`), undo/redo history, and clean preview mode.
|
|
174
98
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
-
|
|
178
|
-
- **Hızlı Şablon Ekleme:** Alt kısımdaki `+ Yeni Satır Ekle`, `+ 6 + 6`, `+ 4 + 4 + 4`, `+ 3 × 4`, `+ 8 + 4` butonlarıyla tek tıkla çok sütunlu satırlar oluşturabilirsiniz.
|
|
99
|
+

|
|
100
|
+

|
|
101
|
+

|
|
179
102
|
|
|
180
|
-
|
|
103
|
+
### 2.2 Built-in Media Library Studio & `sharp` On-the-Fly + CDN Thumbnail Pipeline
|
|
104
|
+
- **Full Media Library Studio (`StrapiMediaPicker`):** Folder navigation & folder creation, multi-file upload, multi-select with order badges (`✓ 1`, `✓ 2`), type filtering (`Images`, `Videos`, `Docs`), metadata editing (`name`, `alternativeText`, `caption`, `folder`), asset deletion, and an interactive **Crop & Rotate Studio** (`Free`, `1:1`, `16:9`, `4:3`, `3:2`, `4:5`, `-90°/+90°`, `Duplicate & Crop` or `Crop Original Asset`).
|
|
105
|
+
- **On-the-Fly `sharp` Endpoint (`/api/content-input/image`) & Automatic CDN Upload:**
|
|
106
|
+
- When a `gallery` widget uses `imageSettings` (`process: 'fit'` for `cWidth × cHeight` crop, or `process: 'widen'` for `cWidth` scaling), `sharp` generates the exact thumbnail on the backend, uploads the generated variant to Strapi's active Upload Provider / CDN (`strapi.plugin('upload').service('provider').upload`), persists the CDN URL in `file.formats['ci_fit_WxH']`, and caches it with immutable HTTP headers.
|
|
107
|
+
- Clicking any gallery image opens the **Popup Lightbox** with the **full-resolution uncropped original image**.
|
|
108
|
+
- **Official Swiper.js Engine (`swiper/react` & `swiper/vue`):**
|
|
109
|
+
- Supports touch/mouse drag-to-swipe (`grabCursor`), mousewheel scrolling (`mousewheel`), transition effects (`slide`, `fade`, `cube`, `coverflow`, `flip`), `slidesPerView`, `spaceBetween`, `loop`, `autoplay`, `navigation`, and `pagination`.
|
|
181
110
|
|
|
182
111
|
---
|
|
183
112
|
|
|
184
|
-
|
|
113
|
+
## 3. Component Map Keys (`widget.id`) & Reference Table
|
|
185
114
|
|
|
186
|
-
|
|
115
|
+
All 13 built-in widgets use the following `widget.id` keys across the Strapi Visual Editor and both Nuxt storefront renderers (`@ozguraltan/strapi-content-input-nuxt-vuetify` and `@ozguraltan/strapi-content-input-nuxt-element-plus`):
|
|
187
116
|
|
|
188
|
-
|
|
117
|
+
| Component Map Key (`widget.id`) | Category | `slotContext` Helper Property | Description & Supported Scenarios |
|
|
118
|
+
| :--- | :--- | :--- | :--- |
|
|
119
|
+
| `HtmlEditor` | Content & Typography | `resolvedHtml` (`string`) | WYSIWYG rich HTML editor with source code view, media download link picker, transparent default background, and automatic `baseUrl` resolution for `/uploads/...` URLs. |
|
|
120
|
+
| `heading` | Content & Typography | `headingData` (`{ text, tag, align, color, fontSize, fontWeight }`) | Semantic heading (`h1`–`h6`) with alignment (`left`, `center`, `right`), color, font size, and weight. |
|
|
121
|
+
| `button` | Interactive & Navigation | `buttonData` (`{ label, url, target, variant, size, align }`) | CTA button supporting `primary`, `secondary`, `outline`, `ghost` variants and `sm`, `md`, `lg` sizes. |
|
|
122
|
+
| `singleImage` | Media & Visuals | `widget.data` (`{ image, alt, caption, link, objectFit, borderRadius, maxWidth }`) | Single image with caption, border radius, `cover`/`contain` mode, and optional external link. |
|
|
123
|
+
| `spacer` | Layout | `widget.data` (`{ height, divider, dividerColor, lineWidth }`) | Configurable vertical space (`height` in `px`) with optional horizontal divider line. |
|
|
124
|
+
| `gallery` | Media & Visuals | `galleryList` (`CIMediaAsset[]`) | **Swiper Carousel (`kind: 'swiper'`):** Official Swiper.js with mouse/touch drag, mousewheel, `slide`/`fade`/`cube`/`coverflow`/`flip` effects, `slidesPerView`, `spaceBetween`, `loop`, `autoplay`.<br>**Grid Gallery (`kind: 'gridGallery'`):** 5-breakpoint `itemsPerRow`, `aspectRatio`, `gridPadding`.<br>**Thumbnails vs Lightbox:** `sharp` `fit`/`widen` thumbnails in slides, **full-size original image** in Lightbox Popup. |
|
|
125
|
+
| `youtubeVideo` | Media & Visuals | `ytData` (`{ videos, title, activeTitle, description, activeVideoId, thumb, isPopup, isThumbnailMode, iframeUrl, watchUrl }`) | Custom cover thumbnail (`customThumbnail`), hover animated Play button, Lightbox modal player (`popup: true`) with multi-video playlist, or inline card playback (`popup: false`). |
|
|
126
|
+
| `tab` | Interactive & Navigation | `tabAccItems` (`NormalizedTabAccItem[]`) | Horizontal or vertical tabs (`options.vertical`, `options.grow`). Each tab supports both Rich HTML (`contentMode: 'text'`) and recursive nested `ContentInput` rows (`contentMode: 'builder'`). |
|
|
127
|
+
| `accordion` | Interactive & Navigation | `tabAccItems` (`NormalizedTabAccItem[]`) | Single or multi-open (`options.multiple`) accordion panels with custom header colors (`header.color`, `header.textColor`), Rich HTML, and nested `ContentInput` rows. |
|
|
128
|
+
| `menu` | Dynamic & Modules | `menuData` (`{ name, mode, items: CIMenuNodeItem[] }`) | Unlimited-depth hierarchical menu (`horizontal` dropdowns & `vertical` collapsible tree), reusable DB menu templates (`plugin::content-input.ci-menu`), and Strapi Collection-Type entity tree picker. |
|
|
129
|
+
| `contentForm` | Dynamic & Modules | `formData` (`{ id, name, action, redirect }`) | Interactive form widget that emits `@submit-form` (`{ formId, fullName, email, message }`) in Nuxt storefront renderers. |
|
|
130
|
+
| `iframe` | Media & Visuals | `widget.data` (`string` or `{ url, height }`) | Embedded iframe (OpenStreetMap, Google Maps, external embeds) with configurable height. |
|
|
131
|
+
| `banner` | Media & Visuals | `widget.data` (`{ banner: { id, name } }`) | Campaign / promotional banner widget designed to be easily customized via slots or `:components`. |
|
|
189
132
|
|
|
190
133
|
---
|
|
191
134
|
|
|
192
|
-
|
|
135
|
+
## 4. Storefront Customization Guide (Nuxt Vuetify & Element Plus)
|
|
193
136
|
|
|
194
|
-
|
|
195
|
-
- **Üst Araç Çubuğu:**
|
|
196
|
-
- **Sol / Sağ Menü Aç-Kapa (`Sol Menü` / `Sağ Menü`):** Sabit yan panelleri tek tıkla gizleyip açabilir veya kenar çizgilerinden **sürükleyerek genişliklerini (resizable) değiştirebilirsiniz**.
|
|
197
|
-
- **Kırılım Noktaları (`SM`, `MD`, `LG`, `XL`, `2XL`):** Farklı ekran boyutları arasında anında geçiş yapar.
|
|
198
|
-
- **Özel Piksel Genişlik ve Ölçekleme (`1024px`, `Sığdır`, `%50`–`%125`):** `cms-core`'daki gibi tuvali istediğiniz piksel genişliğine ayarlayabilir veya ekrana otomatik sığdırabilirsiniz (`Sığdır`).
|
|
199
|
-
- **Önizleme Modu (`Önizleme`):** Tüm kenarlık ve seçim çerçevelerini gizleyerek saf son kullanıcı görünümünü sunar.
|
|
200
|
-
- **Sol Panel:** Bileşen kütüphanesi (`Bileşenler`), sayfa ağacı (`Katmanlar`) ve hazır satır düzenleri (`Şablonlar`).
|
|
201
|
-
- **Sağ Panel (Özellik Denetçisi):** Seçili satır, blok veya bileşenin içerik, stil ve responsive ızgara ayarlarını gerçek zamanlı düzenler.
|
|
137
|
+
Both `@ozguraltan/strapi-content-input-nuxt-vuetify` and `@ozguraltan/strapi-content-input-nuxt-element-plus` provide **3 ways** to customize widget rendering in your Nuxt 3/4 or Vue 3 application:
|
|
202
138
|
|
|
203
|
-
|
|
139
|
+
### Method 1: Scoped Slots (`#widget-<id>` or `#<id>`)
|
|
140
|
+
Override individual widgets inline while keeping the responsive 12-column grid and all other default widgets intact (automatically inherited by nested Tabs and Accordions):
|
|
204
141
|
|
|
205
|
-
|
|
142
|
+
```vue
|
|
143
|
+
<template>
|
|
144
|
+
<ContentInputPreview :model-value="page.content" base-url="http://localhost:1337">
|
|
145
|
+
<template #widget-banner="{ data, options }">
|
|
146
|
+
<MyCustomBanner :banner="data?.banner" :options="options" />
|
|
147
|
+
</template>
|
|
206
148
|
|
|
207
|
-
|
|
149
|
+
<template #widget-contentForm="{ formData, submitForm }">
|
|
150
|
+
<MyCustomContactForm :form="formData" @send="submitForm" />
|
|
151
|
+
</template>
|
|
152
|
+
</ContentInputPreview>
|
|
153
|
+
</template>
|
|
154
|
+
```
|
|
208
155
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
156
|
+
### Method 2: Component Map Override Prop (`:components`)
|
|
157
|
+
Pass an object mapping any `widget.id` key from the table above to your own Vue component:
|
|
158
|
+
|
|
159
|
+
```vue
|
|
160
|
+
<template>
|
|
161
|
+
<ContentInputPreview
|
|
162
|
+
:model-value="page.content"
|
|
163
|
+
base-url="http://localhost:1337"
|
|
164
|
+
:components="{
|
|
165
|
+
banner: MyCustomBanner,
|
|
166
|
+
contentForm: MyCustomContactForm,
|
|
167
|
+
youtubeVideo: MyCustomVideoPlayer,
|
|
168
|
+
}"
|
|
169
|
+
/>
|
|
170
|
+
</template>
|
|
171
|
+
```
|
|
212
172
|
|
|
213
|
-
|
|
173
|
+
### Method 3: CLI Template Ejection (`npx ... eject`)
|
|
174
|
+
Copy the entire set of Vue SFC templates (`ContentInputPreview.vue`, `CIRow.vue`, `CIBlock.vue`, `CIWidget.vue`) and `utils/helpers.ts` directly into your project so you can edit every line of template/CSS freely:
|
|
214
175
|
|
|
215
|
-
|
|
176
|
+
```bash
|
|
177
|
+
# For Nuxt + Vuetify projects:
|
|
178
|
+
npx strapi-content-input-vuetify eject ./components/content-input
|
|
216
179
|
|
|
217
|
-
|
|
180
|
+
# For Nuxt + Element Plus projects:
|
|
181
|
+
npx strapi-content-input-ep eject ./components/content-input
|
|
218
182
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
- *Yukarı / Aşağı Taşı (`Alt+↑` / `Alt+↓`)*
|
|
223
|
-
- *Çoğalt (`Ctrl+D`)*, *Kopyala (`Ctrl+C`)*, *Yapıştır (`Ctrl+V`)*, *Sil (`Del`)*
|
|
224
|
-
- **Zengin HTML Editörü (`RichHtmlEditor`):**
|
|
225
|
-
- Varsayılan olarak **WYSIWYG Görsel Modda** çalışır; yalnızca **`<> Kaynak`** butonuna basıldığında ham HTML kodunu gösterir.
|
|
226
|
-
- Arka plan rengi özellikle belirtilmedikçe **transparan (`transparent`)** olarak render edilir.
|
|
227
|
-
- **`Link`** ve **`Dosya / Medya Linki`** butonlarıyla hem harici URL'lere bağlantı verebilir hem de **Strapi Medya Kütüphanesindeki yüklü dosyalar (PDF, görsel, doküman vb.) içinde gezerek indirme (`download`) bağlantısı** ekleyebilirsiniz.
|
|
183
|
+
# Overwrite existing files if needed:
|
|
184
|
+
npx strapi-content-input-vuetify eject ./components/content-input --force
|
|
185
|
+
```
|
|
228
186
|
|
|
229
|
-
|
|
187
|
+
**Requirements for `npx` Ejection:**
|
|
188
|
+
- Node.js `>= 18.0.0`
|
|
189
|
+
- Host project must have `swiper` installed alongside `vuetify` (or `element-plus`):
|
|
190
|
+
```bash
|
|
191
|
+
# Vuetify host project:
|
|
192
|
+
npm install vuetify swiper @mdi/font
|
|
193
|
+
|
|
194
|
+
# Element Plus host project:
|
|
195
|
+
npm install element-plus swiper
|
|
196
|
+
```
|
|
197
|
+
- Import the ejected component directly from your local folder:
|
|
198
|
+
```ts
|
|
199
|
+
import ContentInputPreview from '~/components/content-input/components/ContentInputPreview.vue';
|
|
200
|
+
```
|
|
230
201
|
|
|
231
202
|
---
|
|
232
|
-
|
|
233
|
-
### 2.6 Katmanlar (Layers) Ağacı ve 5 Kırılımlı Responsive Grid Ayarları
|
|
234
|
-
|
|
235
|
-
- **Katmanlar Sekmesi:** Sol paneldeki **Katmanlar** sekmesi tüm sayfa ağacını (`Satır -> Blok -> Bileşen`) listeler; buradan sürükle-bırak ile sıralama değiştirebilir veya sağ tıklayarak bağlam menüsünü açabilirsiniz.
|
|
236
|
-
- **Duyarlı (Responsive) Sütun Yönetimi:** Bir bloğa tıklandığında sağ denetçide `SM`, `MD`, `LG`, `XL` ve `2XL` kırılımları için **Sütun Genişliği (`1/12` – `12/12`)**, **Sol Boşluk / Offset (`0/12` – `11/12`)** ve **Metin Hizalama** ayrı ayrı ayarlanabilir.
|
|
237
|
-
|
|
238
|
-

|
|
239
|
-
|
|
240
203
|
---
|
|
241
204
|
|
|
242
|
-
|
|
205
|
+
# 🇹🇷 Türkçe Dokümantasyon
|
|
243
206
|
|
|
244
|
-
|
|
245
|
-
- **Pop-up'ta Göster (Varsayılan: Açık):** Tıklandığında videoyu sayfa düzenini bozmadan şık bir pop-up (lightbox modal) pencerede açar. İstenirse işaret kaldırılarak kartın kendi içinde (inline) oynatılması sağlanabilir.
|
|
246
|
-
- **Özel Kapak Görseli / Thumbnail (`StrapiMediaPicker`):** **"Medya Seç"** butonuna basıldığında Strapi Medya Kütüphanesindeki yüklü görseller listelenir (veya yeni görsel yüklenir). Özel bir görsel seçildiğinde standart YouTube kartı yerine bu görsel kapak olarak kullanılır ve **üzerine gelindiğinde (hover) ortada Play butonu** belirir.
|
|
207
|
+
## 1. Mevcut Bir Strapi v5 Projesine Kurulum ve Entegrasyon
|
|
247
208
|
|
|
248
|
-
|
|
209
|
+
`@ozguraltan/strapi-content-input`, gelişmiş **ContentInput** görsel sayfa/içerik tasarım motorunu **Strapi v5** ekosistemine yerel bir `json` (`PostgreSQL JSONB`) özel alanı (**Custom Field**) olarak taşır.
|
|
249
210
|
|
|
250
|
-
|
|
211
|
+
### Adım 1: Paketi Strapi Projenize Çekin
|
|
212
|
+
```bash
|
|
213
|
+
npm install @ozguraltan/strapi-content-input
|
|
214
|
+
# veya GitLab üzerinden:
|
|
215
|
+
npm install git+ssh://git@gitlab.com:ozguraltan/strapi-content-input.git
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Adım 2: `config/plugins.ts` İçinde Etkinleştirin
|
|
219
|
+
```ts
|
|
220
|
+
export default () => ({
|
|
221
|
+
'content-input': {
|
|
222
|
+
enabled: true,
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
```
|
|
251
226
|
|
|
252
|
-
|
|
227
|
+
### Adım 3: `schema.json` İçine Custom Field Olarak Ekleyin
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"attributes": {
|
|
231
|
+
"title": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"required": true
|
|
234
|
+
},
|
|
235
|
+
"content": {
|
|
236
|
+
"type": "customField",
|
|
237
|
+
"customField": "plugin::content-input.content-input"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
```
|
|
253
242
|
|
|
254
243
|
---
|
|
255
244
|
|
|
256
|
-
|
|
245
|
+
## 2. Öne Çıkan Özellikler
|
|
257
246
|
|
|
258
|
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
|
|
247
|
+
1. **Tam Kapsamlı Medya Kütüphanesi Stüdyosu (`StrapiMediaPicker`) & `sharp` + CDN Senkronizasyonu:**
|
|
248
|
+
- Klasör gezintisi, yeni klasör oluşturma, çoklu görsel seçimi (`✓ 1`, `✓ 2` sıra rozetleriyle), meta veri düzenleme (`name`, `alternativeText`, `caption`, `folder`), medya silme ve etkileşimli **Kırpma & Döndürme (Crop & Rotate)** stüdyosu.
|
|
249
|
+
- Galeri bileşeninde `Fit / Crop (cWidth × cHeight)` veya `Widen (cWidth)` seçildiğinde `sharp` ile üretilen thumbnail'ler `strapi.plugin('upload').service('provider').upload` üzerinden otomatik olarak tanımlı **CDN / Upload Provider'a** yüklenir ve `formats` alanına kaydedilir.
|
|
250
|
+
- Galeri/Swiper içinde bu `sharp` thumbnail'leri gösterilirken, görsele tıklanıp **Lightbox Popup** açıldığında görselin **kırpılmamış tam boyutlu orijinal hali** gösterilir.
|
|
251
|
+
2. **Gerçek Swiper.js Motoru (`swiper/react` & `swiper/vue`):**
|
|
252
|
+
- Fareyle tutup sürükleme (`grabCursor` / swipe), fare tekerleği ile geçiş (`mousewheel`), `slide`, `fade`, `cube`, `coverflow`, `flip` efektleri, `slidesPerView`, `spaceBetween`, `loop` ve `autoplay` özellikleri hem Strapi görsel editöründe hem de Nuxt paketlerinde resmi Swiper.js ile çalışır.
|
|
253
|
+
3. **Sekme (`tab`) & Akordiyon (`accordion`) İçinde İç İçe (Nested) ContentInput:**
|
|
254
|
+
- Her sekme veya akordiyon paneli hem zengin HTML metin hem de kendi içinde yeni satır/sütun/bileşen ızgarası (`ContentInput`) barındırabilir.
|
|
263
255
|
|
|
264
|
-

|
|
257
|
+

|
|
258
|
+

|
|
259
|
+

|
|
265
260
|
|
|
266
261
|
---
|
|
267
262
|
|
|
268
|
-
## 3.
|
|
269
|
-
|
|
270
|
-
| Kategori | Bileşen ID | Etiket | Açıklama |
|
|
271
|
-
| :--- | :--- | :--- | :--- |
|
|
272
|
-
| **Temel İçerik** | `HtmlEditor` | Metin Editörü | WYSIWYG zengin metin, kaynak kodu, dosya indirme linki ve transparan arka plan |
|
|
273
|
-
| **Temel İçerik** | `heading` | Başlık | `H1`–`H6` seviye, hizalama ve renk seçenekli başlık |
|
|
274
|
-
| **Temel İçerik** | `button` | Buton | `primary`, `secondary`, `outline`, `ghost` varyantlı aksiyon butonu |
|
|
275
|
-
| **Temel İçerik** | `spacer` | Boşluk | Piksel yüksekliği ve isteğe bağlı ayırıcı çizgi (divider) |
|
|
276
|
-
| **Medya & Görsel** | `singleImage` | Tek Görsel | Strapi Medya Kütüphanesi entegrasyonlu, altyazılı ve linkli görsel |
|
|
277
|
-
| **Medya & Görsel** | `gallery` | Galeri | Çoklu görsel kaydırıcı (`carousel`) veya çok sütunlu ızgara (`grid`) |
|
|
278
|
-
| **Medya & Görsel** | `youtubeVideo` | YouTube Video | Pop-up modal oynatıcı (varsayılan açık), özel kapak görseli ve çoklu video |
|
|
279
|
-
| **Düzen & Etkileşim** | `tab` | Sekme (Tab) | Her sekmede HTML Editör (varsayılan) veya iç içe `ContentInput` ızgarası |
|
|
280
|
-
| **Düzen & Etkileşim** | `accordion` | Akordiyon | Her panelde HTML Editör (varsayılan) veya iç içe `ContentInput` ızgarası |
|
|
281
|
-
| **Dinamik & Modüller** | `menu` | Menü | Yatay/Düşey nested ağaç menü, DB şablon kaydı ve Strapi Entity arama/ağaç |
|
|
282
|
-
| **Dinamik & Modüller** | `contentForm` | Form | Dinamik form kimliği, aksiyon butonu ve yönlendirme adresi |
|
|
283
|
-
| **Dinamik & Modüller** | `iframe` | Iframe | Harita veya harici sayfa yerleştirme (özelleştirilebilir yükseklik) |
|
|
284
|
-
| **Dinamik & Modüller** | `banner` | Banner | Kampanya ve tanıtım alanı (`grid` / `carousel`) |
|
|
285
|
-
|
|
286
|
-
---
|
|
263
|
+
## 3. Bileşen Haritası Anahtarları (`widget.id`) ve Nuxt Özelleştirme Rehberi
|
|
287
264
|
|
|
288
|
-
|
|
265
|
+
Nuxt 3/4 (`@ozguraltan/strapi-content-input-nuxt-vuetify` ve `@ozguraltan/strapi-content-input-nuxt-element-plus`) tarafında `:components` prop'u veya `#widget-<id>` slotları için kullanılan tüm `widget.id` anahtarları:
|
|
289
266
|
|
|
290
|
-
|
|
267
|
+
| Anahtar (`widget.id`) | Etiket | `slotContext` Verisi | Açıklama |
|
|
268
|
+
| :--- | :--- | :--- | :--- |
|
|
269
|
+
| `HtmlEditor` | Metin Editörü | `resolvedHtml` | WYSIWYG zengin metin, kaynak kodu, dosya indirme linki ve transparan arka plan |
|
|
270
|
+
| `heading` | Başlık | `headingData` | `H1`–`H6` seviye, hizalama, boyut ve renk seçenekli başlık |
|
|
271
|
+
| `button` | Buton | `buttonData` | `primary`, `secondary`, `outline`, `ghost` varyantlı ve `sm`/`md`/`lg` boyutlu aksiyon butonu |
|
|
272
|
+
| `spacer` | Boşluk | `data` | Piksel yüksekliği ve isteğe bağlı ayırıcı çizgi (`divider: true`) |
|
|
273
|
+
| `singleImage` | Tek Görsel | `data` | Alt yazılı, köşe yuvarlatmalı (`borderRadius`) ve dış linkli görsel |
|
|
274
|
+
| `gallery` | Galeri | `galleryList` | Resmi **Swiper.js** (`swiper`) veya çok sütunlu ızgara (`gridGallery`) + `sharp` thumbnail + tam boyutlu Lightbox Popup |
|
|
275
|
+
| `youtubeVideo` | YouTube Video | `ytData` | Özel kapak görseli (`customThumbnail`), hover Play butonu, çoklu videolu Lightbox modal veya kart içi oynatıcı |
|
|
276
|
+
| `tab` | Sekme (Tab) | `tabAccItems` | Yatay/Dikey sekmeler; zengin HTML ve iç içe (nested) `ContentInput` ızgarası |
|
|
277
|
+
| `accordion` | Akordiyon | `tabAccItems` | Tekli/Çoklu açılır paneller; özel başlık renkleri, zengin HTML ve iç içe `ContentInput` ızgarası |
|
|
278
|
+
| `menu` | Menü | `menuData` | Yatay/Düşey sınırsız kırılımlı ağaç menü, DB şablon kaydı ve Strapi Entity ağaç seçici |
|
|
279
|
+
| `contentForm` | Form | `formData`, `submitForm` | Form kimliği, aksiyon butonu ve `@submit-form` event desteği |
|
|
280
|
+
| `iframe` | Iframe | `data` | Harita veya harici sayfa yerleştirme (özelleştirilebilir yükseklik) |
|
|
281
|
+
| `banner` | Banner | `data` | Kampanya ve tanıtım alanı (`#widget-banner` veya `:components="{ banner: MyBanner }"` ile özelleştirmeye hazır) |
|
|
282
|
+
|
|
283
|
+
### `npx` Komutu ile Nuxt Şablonlarını Projeye Kopyalama (`eject`)
|
|
284
|
+
```bash
|
|
285
|
+
# Vuetify projeleri için:
|
|
286
|
+
npx strapi-content-input-vuetify eject ./components/content-input
|
|
291
287
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
{
|
|
295
|
-
"_uId": "row_1",
|
|
296
|
-
"cols": [],
|
|
297
|
-
"offset": [0, 0, 0, 0, 0],
|
|
298
|
-
"layoutProps": {
|
|
299
|
-
"align": ["start", "start", "start", "start", "start"]
|
|
300
|
-
},
|
|
301
|
-
"styleOptions": {
|
|
302
|
-
"backgroundColor": "#f5f7fa",
|
|
303
|
-
"padding": "32px 24px",
|
|
304
|
-
"borderRadius": "8px"
|
|
305
|
-
},
|
|
306
|
-
"bgImage": null,
|
|
307
|
-
"bgOptions": {},
|
|
308
|
-
"parallax": false,
|
|
309
|
-
"blocks": [
|
|
310
|
-
{
|
|
311
|
-
"_uId": "block_1",
|
|
312
|
-
"cols": [12, 12, 6, 6, 6],
|
|
313
|
-
"offset": [0, 0, 0, 0, 0],
|
|
314
|
-
"layoutProps": {},
|
|
315
|
-
"styleOptions": { "padding": "16px" },
|
|
316
|
-
"widgets": [
|
|
317
|
-
{
|
|
318
|
-
"_uId": "widget_1",
|
|
319
|
-
"id": "HtmlEditor",
|
|
320
|
-
"options": {},
|
|
321
|
-
"data": "<h2>Kurumsal Çözümler</h2><p>Detaylı açıklama metni...</p>"
|
|
322
|
-
}
|
|
323
|
-
]
|
|
324
|
-
}
|
|
325
|
-
]
|
|
326
|
-
}
|
|
327
|
-
]
|
|
288
|
+
# Element Plus projeleri için:
|
|
289
|
+
npx strapi-content-input-ep eject ./components/content-input
|
|
328
290
|
```
|
|
329
291
|
|
|
330
|
-
> Tüm bileşenlerin detaylı TypeScript arayüzleri ve alt veri şemaları için **[AGENTS.md](./AGENTS.md)** dosyasına başvurabilirsiniz.
|
|
331
|
-
|
|
332
292
|
---
|
|
333
293
|
|
|
334
|
-
##
|
|
335
|
-
|
|
336
|
-
Bu repo içinde eklentiyi anında test edebileceğiniz hazır bir **Strapi v5 Playground** (`./playground`) ve **Docker PostgreSQL** kurulumu yer almaktadır:
|
|
294
|
+
## 4. Lokal Geliştirme ve Playground Ortamları
|
|
337
295
|
|
|
338
296
|
```bash
|
|
339
|
-
# 1. PostgreSQL
|
|
297
|
+
# 1. PostgreSQL veritabanını başlatın
|
|
340
298
|
npm run db:up
|
|
341
299
|
|
|
342
|
-
# 2.
|
|
343
|
-
npm run build
|
|
344
|
-
npm run verify
|
|
345
|
-
|
|
346
|
-
# 3. Playground uygulamasını derleyip başlatın
|
|
347
|
-
cd playground
|
|
300
|
+
# 2. Strapi eklentisini derleyin ve Playground'u başlatın (Port 1337)
|
|
348
301
|
npm run build
|
|
349
|
-
npm run
|
|
302
|
+
npm --prefix playground run dev
|
|
350
303
|
```
|
|
351
304
|
|
|
352
|
-
- **Strapi Admin Paneli:** `http://localhost:1337/admin`
|
|
353
|
-
- **
|
|
354
|
-
- **
|
|
305
|
+
- **Strapi Admin Paneli:** `http://localhost:1337/admin` (`ozguraltan05@gmail.com` / `12345678`)
|
|
306
|
+
- **Nuxt Vuetify Playground:** `http://localhost:3001`
|
|
307
|
+
- **Nuxt Element Plus Playground:** `http://localhost:3002`
|