@ozguraltan/strapi-content-input 1.0.11 → 1.0.21
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 +373 -62
- package/dist/admin/AnalyticsHubPage-0p0Mx4AU.js +688 -0
- package/dist/admin/AnalyticsHubPage-DsrcGI_Y.mjs +688 -0
- package/dist/admin/ContentInputField-7rWLSx_7.js +31864 -0
- package/dist/admin/ContentInputField-CHXrzvE-.mjs +31844 -0
- package/dist/admin/SurveyWidgetEditor-BVN6X_3G.mjs +10811 -0
- package/dist/admin/SurveyWidgetEditor-BmgYQaQS.js +10813 -0
- package/dist/admin/{en-DF-a59T_.js → en-BZg845za.js} +2 -1
- package/dist/admin/{en-D7v9nv9J.mjs → en-C9LN2PJY.mjs} +2 -1
- package/dist/admin/{index-DKVaYg3t.js → index-CZAwXCFH.js} +53 -4
- package/dist/admin/{index-DGBgjAUa.mjs → index-hFIuYqu5.mjs} +53 -4
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/analytics/SurveyAnalyticsView.d.ts +6 -0
- package/dist/admin/src/components/color-codes/ColorCodesManager.d.ts +10 -0
- package/dist/admin/src/components/common/CIAspectRatioField.d.ts +35 -0
- package/dist/admin/src/components/common/CIColorField.d.ts +13 -0
- package/dist/admin/src/components/widgets/ContentFormWidgetEditor.d.ts +81 -0
- package/dist/admin/src/components/widgets/CustomCardWidgetEditor.d.ts +83 -0
- package/dist/admin/src/components/widgets/DataTableWidgetEditor.d.ts +65 -0
- package/dist/admin/src/components/widgets/EntityCardWidgetEditor.d.ts +56 -0
- package/dist/admin/src/components/widgets/HeroSliderStage.d.ts +153 -0
- package/dist/admin/src/components/widgets/HeroSliderWidgetEditor.d.ts +21 -0
- package/dist/admin/src/components/widgets/StrapiMediaPicker.d.ts +2 -0
- package/dist/admin/src/components/widgets/SurveyWidgetEditor.d.ts +91 -0
- package/dist/admin/src/core/colorUtils.d.ts +30 -0
- package/dist/admin/src/core/sampleData.d.ts +2 -1
- package/dist/admin/src/core/useColorCodes.d.ts +43 -0
- package/dist/admin/src/core/useStrapiLocales.d.ts +13 -0
- package/dist/admin/src/pages/AnalyticsHubPage.d.ts +3 -0
- package/dist/admin/{tr-ByHzf64V.mjs → tr-MtQFY92V.mjs} +2 -1
- package/dist/admin/{tr-SNvSmKZQ.js → tr-ZEmzAvKR.js} +2 -1
- package/dist/server/index.js +5043 -57
- package/dist/server/index.mjs +5043 -57
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/content-types/ci-color-palette/schema.json.d.ts +52 -0
- package/dist/server/src/content-types/ci-form/schema.json.d.ts +77 -0
- package/dist/server/src/content-types/ci-form-submission/schema.json.d.ts +54 -0
- package/dist/server/src/content-types/ci-survey/schema.json.d.ts +111 -0
- package/dist/server/src/content-types/ci-survey-response/schema.json.d.ts +81 -0
- package/dist/server/src/content-types/index.d.ts +365 -0
- package/dist/server/src/controllers/ci-color.d.ts +14 -0
- package/dist/server/src/controllers/ci-form.d.ts +17 -0
- package/dist/server/src/controllers/ci-survey.d.ts +18 -0
- package/dist/server/src/controllers/index.d.ts +43 -0
- package/dist/server/src/index.d.ts +850 -1
- package/dist/server/src/services/ci-color.d.ts +127 -0
- package/dist/server/src/services/ci-form.d.ts +250 -0
- package/dist/server/src/services/ci-survey.d.ts +296 -0
- package/dist/server/src/services/index.d.ts +441 -0
- package/dist/server/src/utils/formValidator.d.ts +19 -0
- package/dist/server/src/utils/mailer.d.ts +42 -0
- package/dist/server/src/utils/surveyEngine.d.ts +252 -0
- package/dist/server/src/utils/surveySeedData.d.ts +4 -0
- package/package.json +3 -2
- package/dist/admin/ContentInputField-BGJmgYGQ.js +0 -19919
- package/dist/admin/ContentInputField-BLiKYZ7b.mjs +0 -19916
package/README.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# @ozguraltan/strapi-content-input
|
|
2
2
|
|
|
3
|
-
**Visual Page & Content Builder (`JSONB` Custom Field) for Strapi v5**
|
|
3
|
+
**Visual Page & Content Builder (`JSONB` Custom Field), Hero Slider, Data Tables, Custom Card Studio, Color Codes Theme Engine, Dynamic Form Studio & Enterprise Survey Hub for Strapi v5**
|
|
4
4
|
|
|
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`)**.
|
|
5
|
+
`@ozguraltan/strapi-content-input` brings an enterprise-grade visual page and layout builder (**18 built-in widgets**) 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
|
+
- **Plugin Content-Types:**
|
|
10
|
+
- `plugin::content-input.ci-color-palette` (`ci_color_palettes` — Semantic & custom brand **Color Codes** palettes with `HEX`, `RGB/RGBA` & `--ci-color-*` CSS variables)
|
|
11
|
+
- `plugin::content-input.ci-template` (`ci_templates` — Reusable Row, Block, Widget & **Custom Card Design** templates)
|
|
12
|
+
- `plugin::content-input.ci-menu` (`ci_menus` — Reusable hierarchical menus)
|
|
13
|
+
- `plugin::content-input.ci-form` (`ci_forms` — Dynamic `cms-core`-style forms, validation rules & mail configs)
|
|
14
|
+
- `plugin::content-input.ci-form-submission` (`ci_form_submissions` — Recorded form submissions & delivery logs)
|
|
15
|
+
- `plugin::content-input.ci-survey` (`ci_surveys` — Multi-step surveys, quick polls, conditional skip logic, lifecycle & anti-duplicate rules)
|
|
16
|
+
- `plugin::content-input.ci-survey-response` (`ci_survey_responses` — Recorded survey votes, completion duration, locale & salted voter hash)
|
|
17
|
+
- **Strapi Admin Left Sidebar Page:** `/admin/plugins/content-input` (**Surveys, Forms & Color Codes Hub**)
|
|
9
18
|
- **Database Column Type:** `json` (stored as `JSONB` in PostgreSQL)
|
|
19
|
+
- **CI/CD & Packaging:** `dist/` is intentionally untracked in Git (`.gitignore`); packages compile automatically in GitLab CI (`.gitlab-ci.yml`) and on `npm install` via `"prepare": "npm run build"`.
|
|
10
20
|
- **Companion Storefront Renderers:**
|
|
11
21
|
- **Vuetify (3.5+ / 4.+):** `@ozguraltan/strapi-content-input-nuxt-vuetify` (`npx strapi-content-input-vuetify eject`)
|
|
12
22
|
- **Element Plus (2.7+ / 3.x):** `@ozguraltan/strapi-content-input-nuxt-element-plus` (`npx strapi-content-input-ep eject`)
|
|
@@ -27,8 +37,9 @@ npm install @ozguraltan/strapi-content-input
|
|
|
27
37
|
npm install git+ssh://git@gitlab.com:ozguraltan/strapi-content-input.git
|
|
28
38
|
```
|
|
29
39
|
|
|
30
|
-
### Step 2: Enable in `config/plugins.ts`
|
|
40
|
+
### Step 2: Enable in `config/plugins.ts` & `config/features.ts`
|
|
31
41
|
```ts
|
|
42
|
+
// config/plugins.ts
|
|
32
43
|
export default () => ({
|
|
33
44
|
'content-input': {
|
|
34
45
|
enabled: true,
|
|
@@ -36,6 +47,14 @@ export default () => ({
|
|
|
36
47
|
});
|
|
37
48
|
```
|
|
38
49
|
|
|
50
|
+
For **Strapi v5.61+**, enable `useLegacyMediaLibrary: true` in `config/features.ts` so Strapi's full-featured classic **Media Library Modal** (with thumbnails, pagination, folder management, upload, and built-in Cropper.js image cropping) opens across all ContentInput widgets and full-screen studios:
|
|
51
|
+
```ts
|
|
52
|
+
// config/features.ts
|
|
53
|
+
export default () => ({
|
|
54
|
+
useLegacyMediaLibrary: true,
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
39
58
|
### Step 3: Configure Content Security Policy in `config/middlewares.ts`
|
|
40
59
|
To allow YouTube iframe embeds and external/CDN media previews inside the Strapi Admin panel:
|
|
41
60
|
```ts
|
|
@@ -100,39 +119,250 @@ export default [
|
|
|
100
119
|

|
|
101
120
|

|
|
102
121
|
|
|
103
|
-
### 2.2
|
|
104
|
-
- **
|
|
122
|
+
### 2.2 Official Strapi Native Media Library Modal + `sharp` On-the-Fly + CDN Thumbnail Pipeline
|
|
123
|
+
- **Official Strapi Media Library Modal (`components['media-library']` in `StrapiMediaPicker`):** Every media field across all 18 widgets and full-screen studios (`heroSlider` background image/video & floating layer, `customCard` media & author avatar, `entityCard`, `survey` image choice, `gallery`, `singleImage`, `youtubeVideo`, `banner`, `button`, `StyleControls`, and `RichHtmlEditor`) opens Strapi's **official native Media Library Dialog** (`z-index: 310` cleanly above all `200–270` ContentInput studios) with full-color thumbnails, pagination, folder navigation/creation, drag-and-drop upload, asset metadata editing, and Strapi's built-in **Cropper.js** cropper — plus an optional 1-click inline `sharp` **Crop & Rotate Studio** (`Free`, `1:1`, `16:9`, `4:3`, `3:2`, `4:5`, `-90°/+90°`, `Duplicate & Crop` or `Crop Original Asset`).
|
|
105
124
|
- **On-the-Fly `sharp` Endpoint (`/api/content-input/image`) & Automatic CDN Upload:**
|
|
106
125
|
- 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
126
|
- Clicking any gallery image opens the **Popup Lightbox** with the **full-resolution uncropped original image**.
|
|
108
|
-
- **Official Swiper.js Engine
|
|
109
|
-
- Supports touch/mouse drag-to-swipe (`grabCursor`), mousewheel scrolling (`mousewheel`), transition effects (`slide`, `fade`, `cube`, `coverflow`, `flip`), `slidesPerView`, `spaceBetween`, `loop`, `autoplay`,
|
|
127
|
+
- **Official Swiper.js Engine + Native Framework Navigation Buttons (`CISwiperNavButtons`):**
|
|
128
|
+
- Supports touch/mouse drag-to-swipe (`grabCursor`), mousewheel scrolling (`mousewheel`), transition effects (`slide`, `fade`, `cube`, `coverflow`, `flip`), `slidesPerView`, `spaceBetween`, `loop`, `autoplay`, and `pagination`.
|
|
129
|
+
- Replaces Swiper's oversized raw `.swiper-button-prev`/`.swiper-button-next` chevrons across `heroSlider`, `gallery`, `entityCard`, and `customCard` with genuine Vuetify `<v-btn>` and Element Plus `<el-button>` components supporting selectable **`navButtonStyle`** (`'fab' | 'outlined' | 'tonal' | 'icon' | 'square'`), **`navButtonSize`** (`'sm' | 'md' | 'lg'`), and Color Codes / `#HEX` / `RGBA` **`navButtonColor`**.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 3. Dynamic Form Builder (`contentForm`), Shared `vee-validate` Rules, reCAPTCHA v2 & Mail Delivery
|
|
134
|
+
|
|
135
|
+
Inspired by `cms-core`'s dynamic form architecture, `contentForm` provides a complete database-backed form studio, shared client+server validation engine, Google reCAPTCHA v2 protection, and multi-driver email delivery.
|
|
136
|
+
|
|
137
|
+
### 3.1 How Dynamic Forms Work End-to-End
|
|
138
|
+
1. **Database Storage (`ci_forms`) & Full Drag-and-Drop Form Studio:** Forms are created and managed inside the **Full-Screen Form Studio Modal** (accessible directly from any `contentForm` widget in Strapi). Every structural and list element inside the Studio supports **HTML5 Drag & Drop**:
|
|
139
|
+
- **Quick Field Presets & Unassigned Fields:** Drag directly into any column, before/after any field, or onto the bottom "+ New Row" drop zone.
|
|
140
|
+
- **Form Rows & Row Layout Presets (`12`, `6+6`, `4+4+4`, `8+4`):** Drag to reorder rows or insert new grid rows between existing ones.
|
|
141
|
+
- **Columns / Blocks & Placed Fields:** Reorder within the same container or move freely across different columns and rows.
|
|
142
|
+
- **Choice Options (Dynamic Strapi `i18n` Locales) & Active Validation Rules:** Reorder dropdown/radio/checkbox options and rule evaluation priority via drag handles. All localized labels (`alias`, `placeholder`, `hint`, `options.optionList`, `buttonLabel`, `successMessage`) dynamically pull active locales from Strapi's **Internationalization (`i18n`)** plugin (`GET /content-input/locales` & `GET /api/content-input/locales` — e.g. `en`, `tr`, `de`, `fr`, `ar`) with automatic default-locale fallback.
|
|
143
|
+
- Each form stores its responsive 12-column `form` layout (`rows -> blocks -> fields[]`), localized `fields[name]` dictionary (`alias`, `placeholder`, `hint`, `options.optionList`, `validation`), and delivery settings (`to`, `subject`, `buttonLabel`, `successMessage`, `redirect`, `mailConfig`, `useRecaptcha`).
|
|
144
|
+
- Inside the page's `ContentInput` JSONB, only a lightweight reference (`{ formId: "showcase_contact_form", form: { id, documentId, name }, ... }`) is stored.
|
|
145
|
+
2. **Asynchronous Frontend Rendering (`CIDynamicForm.vue`):**
|
|
146
|
+
- Both Nuxt packages asynchronously fetch `GET ${baseUrl}/api/content-input/forms/:id` (secrets such as `mailConfig` and `recaptchaSecretKey` are automatically stripped on the server).
|
|
147
|
+
- Renders 9 field types natively in Vuetify / Element Plus: `input`, `emailInput`, `telInput`, `numeric`, `textArea`, `selectGroup`, `radioGroup`, `checkboxGroup`, `switchBox`.
|
|
148
|
+
3. **Identical Client + Backend Validation (`POST /api/content-input/forms/:id/submit`):**
|
|
149
|
+
- Fields are validated in real time on blur/change in Vue AND re-validated with the **exact same rule parser** on the Strapi backend before saving or sending mail.
|
|
150
|
+
- Invalid requests return **HTTP `422`** with `{ ok: false, errors: { [fieldName]: ["Localized error message"] } }`, which `CIDynamicForm` maps directly onto each input's error state.
|
|
151
|
+
- Valid submissions are persisted in `ci_form_submissions` (`data`, `ipAddress`, `userAgent`, `mailSent`, `mailError`) and dispatched via the configured mail driver.
|
|
152
|
+
|
|
153
|
+
### 3.2 Supported `vee-validate` / `validatorjs` Validation Rules
|
|
154
|
+
Combine rules with pipes (`|`), e.g. `"required|email|max:120"` or `"required|min:10|max:1000"`:
|
|
155
|
+
|
|
156
|
+
| Rule | Example | Description |
|
|
157
|
+
| :--- | :--- | :--- |
|
|
158
|
+
| `required` | `required` | Field must be non-empty (non-blank string, selected option, or non-empty array). |
|
|
159
|
+
| `accepted` | `accepted` | Must be `true`, `'true'`, `1`, `'1'`, `'yes'`, or `'on'` (ideal for GDPR / KVKK `switchBox`). |
|
|
160
|
+
| `email` | `required\|email` | Valid email address format. |
|
|
161
|
+
| `phone` | `phone` | International / local phone format (`+`, digits, spaces, parentheses; min 7 digits). |
|
|
162
|
+
| `url` | `url` | Valid `http://` or `https://` URL. |
|
|
163
|
+
| `numeric` | `required\|numeric` | Numeric value (integers or decimals). |
|
|
164
|
+
| `integer` | `required\|integer` | Whole integer value. |
|
|
165
|
+
| `min:<n>` | `required\|min:3` | Minimum string character length (or minimum selected items for `checkboxGroup`). |
|
|
166
|
+
| `max:<n>` | `max:500` | Maximum string character length (or maximum selected items for `checkboxGroup`). |
|
|
167
|
+
| `min_value:<n>` | `numeric\|min_value:1` | Minimum numeric value (`>= n`). |
|
|
168
|
+
| `max_value:<n>` | `numeric\|max_value:100` | Maximum numeric value (`<= n`). |
|
|
169
|
+
| `between:<min>,<max>` | `numeric\|between:18,99` | Numeric value (or string length) must fall between `min` and `max`. |
|
|
170
|
+
| `alpha` | `alpha` | Alphabetic characters only (includes Turkish/Unicode letters). |
|
|
171
|
+
| `alpha_num` | `alpha_num` | Alphanumeric characters only (includes Turkish/Unicode letters & digits). |
|
|
172
|
+
| `in:<a,b,c>` | `required\|in:Sales,Support` | Value must match one of the comma-separated allowed values. |
|
|
173
|
+
| `regex:<pattern>` | `regex:^[A-Z0-9-]+$` | Value must match the custom regular expression. |
|
|
174
|
+
| `confirmed:<field>` | `confirmed:password` | Value must match another field in the same form. |
|
|
175
|
+
|
|
176
|
+
### 3.3 Google reCAPTCHA v2 & 3rd-Party Mail Delivery (`.env` or Form Studio UI)
|
|
177
|
+
Configure globally in Strapi's `.env` (compatible with `cms-core` env names) **or** override per-form inside Strapi's Form Studio Modal (`Tab 2 -> Mail & reCAPTCHA`):
|
|
178
|
+
|
|
179
|
+
```dotenv
|
|
180
|
+
# Google reCAPTCHA v2 (Renders automatically on frontend when public key is present)
|
|
181
|
+
MIX_RECAPTCHA_PUBLIC_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
|
|
182
|
+
RECAPTCHA_PRIVATE_KEY=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
|
|
183
|
+
|
|
184
|
+
# Mail Delivery Driver: auto | mailtrap | mailgun | smtp | strapi
|
|
185
|
+
MAIL_DRIVER=auto
|
|
186
|
+
MAIL_FROM="Company Website <noreply@example.com>"
|
|
187
|
+
MAIL_TO=info@example.com
|
|
188
|
+
|
|
189
|
+
# 1. Mailtrap HTTP API (Leave MAILTRAP_INBOX_ID empty for Live Sending API, or set Inbox ID for Sandbox Testing)
|
|
190
|
+
MAILTRAP_API_TOKEN=your_mailtrap_api_token_here
|
|
191
|
+
MAILTRAP_INBOX_ID=
|
|
192
|
+
|
|
193
|
+
# 2. Mailgun v3 REST API (api.mailgun.net or api.eu.mailgun.net)
|
|
194
|
+
MAILGUN_SECRET=
|
|
195
|
+
MAILGUN_DOMAIN=
|
|
196
|
+
MAILGUN_HOST=api.mailgun.net
|
|
197
|
+
|
|
198
|
+
# 3. Generic SMTP (or Mailtrap / Mailgun SMTP credentials)
|
|
199
|
+
MAIL_HOST=sandbox.smtp.mailtrap.io
|
|
200
|
+
MAIL_PORT=2525
|
|
201
|
+
MAIL_USERNAME=
|
|
202
|
+
MAIL_PASSWORD=
|
|
203
|
+
MAIL_ENCRYPTION=tls
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## 4. Linked Strapi `entityCard` Widget (Single Card, Swiper.js Carousel & Grid + Collection Feed)
|
|
209
|
+
|
|
210
|
+
The **`entityCard`** widget links to Strapi Collection-Type entries (e.g. `api::page.page`, `api::article.article`, `api::product.product`) and renders single cards, multi-item **Swiper.js Carousels**, or responsive grids:
|
|
211
|
+
1. **Three Display Modes (`options.displayMode`):**
|
|
212
|
+
- `'single'` (default, backward-compatible): Displays one linked Strapi entity card.
|
|
213
|
+
- `'swiper'`: Renders multiple cards inside official **Swiper.js** (`slidesPerView` responsive `[sm, md, lg, xl, 2xl]`, `spaceBetween`, `loop`, `autoplay`, `navigation`, `pagination`, `mousewheel`, `effect`: `slide` / `coverflow` / `cards`).
|
|
214
|
+
- `'grid'`: Renders multiple linked entity cards in a responsive multi-column CSS grid.
|
|
215
|
+
2. **Two Data Modes (`data.sourceMode`):**
|
|
216
|
+
- **Hand-Picked Multi-Entity List (`items[]`):** Pick multiple Strapi records, drag/reorder them, and set optional per-card manual `overrides`.
|
|
217
|
+
- **Automatic Collection Feed (`collectionFeed`):** Automatically pulls the latest `limit` published records from any Strapi collection (`GET ${baseUrl}/api/content-input/entity-cards?uid=...&sort=publishedAt:desc&limit=8`).
|
|
218
|
+
3. **Automatic Entity Fallback + Granular Overrides:** Any override (`image`, `title`, `subtitle`, `description`, `badgeText`, `buttonText`, `url`, `target`, `accentColor`) left blank automatically inherits from the linked Strapi record (including extracting summary text & media from `ContentInput` JSONB!). Each card item can also define its own per-card **`accentColor`** via `<CIColorField />` (Color Codes token, `#HEX`, or `RGBA`).
|
|
219
|
+
4. **Card Carousel Height Equalization (`options.heightMode` & `options.cardHeight`):** Supports `'equal'` (default — stretches all cards in a Swiper row or CSS grid to match the tallest card while pinning CTA buttons flush at the bottom), `'fixed'` (explicit `cardHeight` in `px`, e.g. `420px`), and `'auto'` (natural content height).
|
|
220
|
+
5. **Universal Card Props & Color Codes (`options.cardProps`):** `layout` (`vertical` | `horizontal` | `overlay`), `variant` (`elevated` | `outlined` | `flat` | `tonal`), `elevation`, `rounded`, `color`, `textColor`, `accentColor` (all backed by `<CIColorField />` + Color Codes tokens), `imageHeight`, `showBadge`, `showButton`, `buttonVariant`, `hoverEffect`.
|
|
221
|
+
6. **External Override Support:** Override globally via `:components="{ entityCard: MyEntityCard }"` or inline via `<template #widget-entityCard="{ entityCardData }">`.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## 5. Color Codes Theme Engine, Hero Slider, Data Tables & Custom Card Designer
|
|
226
|
+
|
|
227
|
+
### 5.1 Color Codes (`plugin::content-input.ci-color-palette` & `<CIColorField />`)
|
|
228
|
+
Manage site-wide semantic and custom brand color tokens from **two places** in Strapi Admin (`Left Sidebar -> Surveys, Forms & Colors -> Color Codes` tab, or the **🎨 Color Codes** button in the Visual Editor top bar):
|
|
229
|
+
- **13 Semantic Tokens + Unlimited Custom Tokens:** `primary`, `secondary`, `accent`, `success`, `warning`, `error`, `info`, `surface`, `surfaceAlt`, `background`, `textPrimary`, `textSecondary`, `border` plus custom tokens (e.g. `brandGold`, `ctaCoral`).
|
|
230
|
+
- **Multi-Mode Color Input Everywhere (`Visual Spectrum + #HEX + RGB/RGBA`):**
|
|
231
|
+
- Interactive 2D Saturation/Brightness Spectrum + Hue & Alpha (`0%–100%`) sliders.
|
|
232
|
+
- Explicit **`#HEX`** input (`#RRGGBB` & 8-digit `#RRGGBBAA`) with 1-click copy.
|
|
233
|
+
- Explicit **`RGB / RGBA`** numeric spinboxes (`R: 0–255`, `G: 0–255`, `B: 0–255`, `A: 0–100%`) AND direct `rgb(...)` / `rgba(...)` CSS string input.
|
|
234
|
+
- **"+ Save This Color to Color Codes"**: Save any custom `#HEX` / `rgba(...)` color directly into the active Color Codes palette on the fly from any widget/row/block inspector!
|
|
235
|
+
- **Live `--ci-color-*` CSS Variable Binding:** Widgets bound to a token store `var(--ci-color-primary, #4f46e5)` (plus automatic `--ci-color-primary-rgb` and `-soft` alpha variants). `<ContentInputPreview>` in both Nuxt packages fetches `GET ${baseUrl}/api/content-input/color-codes` (or accepts `:theme-slug="'emerald-fintech'"` / `:color-variables="{ '--ci-color-primary': '#059669' }"`) so switching palettes updates the entire storefront instantly without editing pages!
|
|
236
|
+
|
|
237
|
+
### 5.2 Hero Slider (`heroSlider` — Homepage Multi-Layer Banner Engine & Scaled Live Studio)
|
|
238
|
+
Powered by official **Swiper.js** (`EffectFade`, `EffectCreative`, `EffectCoverflow`, `EffectCube`, `EffectFlip`, `Parallax`, `Autoplay`, `Navigation`, `Pagination`, `Mousewheel`):
|
|
239
|
+
- **Scaled Virtual Viewport Studio (`1280px` / `768px` / `390px` Mobile Portrait) & Live FX Playback:** The full-screen **Hero Slider Live Studio** renders slides at exact target viewport widths (`1280px` Desktop, `768px` Tablet, `390px` Mobile Portrait bezel) scaled dynamically with `ResizeObserver` (`Fit`, `50%`, `75%`, `100%`, `⤢ Zen` mode, `# Grid` `12×12` guide) and live `swiper/react` transition playback (`◀ ▶`, `↻ Efektleri Oynat`, `▶ Auto`).
|
|
240
|
+
- **Freeform Layer Positioning (`X, Y, Width, Height, Z-Index`) + Responsive Overrides:** Each layer (`badge`, `heading`, `subtitle`, `buttons`, `floating_image`, `stats`) supports `positionMode: 'flow' | 'free'`. In `'free'` mode, drag layers directly on the scaled stage or resize with **8 handles** (`dx / effectiveScale` compensated + `50%` center snap guides), use the **9-point quick-align matrix**, and define per-device coordinate overrides (`box`, `boxTablet`, `boxMobile`), `tabletFontSize` / `mobileFontSize`, and `hiddenOn`.
|
|
241
|
+
- **19 Common Aspect Ratio Presets + Manual `W : H` / Pixel Ratio (`<CIAspectRatioField />`):** Choose from **19 categorized presets** (`4:1`, `3:1`, `32:9`, `2.40:1`, `21:9`, `2:1`, `16:9`, `16:10`, `3:2`, `4:3`, `5:4`, `1:1`, `4:5`, `3:4`, `5:7`, `2:3`, `9:16`, `9:19.5`, `9:21`) or enter any custom ratio / pixel pair (`1920:680`, `2.35:1`) globally and per slide across Desktop, Tablet, and Mobile Portrait (also supported in `gallery`).
|
|
242
|
+
- **Dedicated Mobile Portrait Slides & Media Overrides:** Set per-slide `deviceVisibility` (`'all' | 'desktop_tablet' | 'mobile_only' | 'desktop_only' | 'tablet_only'`), clone a desktop slide into a `4:5` vertical mobile slide in 1 click via **"📱 Mobil Portrait Kopyası Türet"**, or set a mobile-only background override (`mobileBgType`, `mobileBgImage`, `mobileBgGradient`, `mobileBgVideoUrl`).
|
|
243
|
+
- **7 Built-in Typographic Effects & Ken Burns:** `none`, `gradient_text`, `typewriter` (live typing/deleting cursor), `rotating_words`, `highlight_marker`, `outline_stroke`, and `glow` + **Ken Burns** motion (`zoom-in`, `zoom-out`, `pan-left`, `pan-right`).
|
|
244
|
+
|
|
245
|
+
### 5.3 Interactive Data Table (`dataTable`)
|
|
246
|
+
Supports **Excel / CSV File Upload**, **Clipboard Paste**, and **Live Strapi Collection** data sources:
|
|
247
|
+
1. **Excel (`.xlsx`, `.xls`) & CSV (`.csv`, `.tsv`) File Upload + Paste Importer (`sourceMode: 'manual'`):** Upload `.xlsx`, `.xls`, `.csv`, or `.tsv` files via drag-and-drop dropzone (powered by `xlsx` / SheetJS with multi-sheet workbook selector, replace vs append mode, and automatic column type inference), paste directly from Excel / Google Sheets, or edit typed cells inline.
|
|
248
|
+
2. **Live Strapi Collection Source + Selectable Fields (`sourceMode: 'strapi_collection'`):** Connect to any allowed Strapi Collection-Type (`GET ${baseUrl}/api/content-input/data-table?uid=api::page.page`), interactively pick **which collection fields** to display via an `availableFields` checklist, reorder columns, customize column headers/formats, and preview live records (`private` / `password` fields and `admin::*` UIDs are strictly blocked on the server).
|
|
249
|
+
3. **Fixed (Sticky) Header + Horizontal & Vertical Scroll:** Configure `stickyHeader` (pins `<thead>` at `top: 0` while scrolling), `verticalScroll` + `maxHeight` (e.g. `360px`–`480px`), `horizontalScroll` + `minTableWidth` (e.g. `960px`–`1040px`), `stickyFirstColumn` (pins the first column at `left: 0` during horizontal scroll), and Color Codes `headerBgColor` / `headerTextColor`.
|
|
250
|
+
4. **9 Rich Column Formats & Interactive Visitor Toolbar:** `text`, `number`, `currency`, `progress` (visual progress bar), `badge` (mapped to Color Codes semantic colors), `boolean`, `image` (with click-to-zoom lightbox), `date`, `link` — plus live search, column sorting, quick filter chips, pagination, summary footer (`SUM` / `AVG` / `COUNT`), zebra striping, and 1-click visitor **CSV Export**.
|
|
251
|
+
|
|
252
|
+
### 5.4 Custom Card Designer (`customCard`)
|
|
253
|
+
Design bespoke cards visually without writing Vue/CSS code, and display them as a **Swiper.js Carousel**, **Responsive Grid**, or **Single Card**:
|
|
254
|
+
- **6 Built-in Card Archetypes:**
|
|
255
|
+
1. `feature` — Icon / Media + Eyebrow + Title + Description + CTA
|
|
256
|
+
2. `pricing` — Plan Name + Price (`₺` / `$` / `/mo`) + Highlighted **"MOST POPULAR"** Ribbon + `✓` Checklist + Full-Width CTA
|
|
257
|
+
3. `testimonial` — Quote + 5-Star Rating + Author Avatar, Name & Role
|
|
258
|
+
4. `profile` — Team Member Photo + Name, Title, Bio & Action Links
|
|
259
|
+
5. `stat` — Big KPI Metric + Trend Badge (`+24.8% ↑`) + Context Label
|
|
260
|
+
6. `overlay_story` — Full-bleed background image with gradient scrim & glassmorphism badge
|
|
261
|
+
- **Vertical Height Equalization, Scaled Live Carousel Stage & Per-Card Accent Color:** Toggle between **`🎯 Single Card`** and **`🎬 Scaled Live Stage` (`1280px` / `768px` / `390px`)** inside the Custom Card Designer Studio to preview multi-card Swiper carousels & grids live; set `heightMode: 'equal' | 'fixed' | 'auto'` (`cardHeight` in `px`) and override **`accentOverride`** per individual card item via `<CIColorField />`.
|
|
262
|
+
- **Visual Style Studio + Reusable Design Presets:** Customize border radius (`0–32px`), border, shadow/glassmorphism, hover animations (`lift`, `glow`, `scale`, `border-accent`), Color Codes bindings, and save/load card styles via **Saved Card Design Templates** (`plugin::content-input.ci-template`, `category: 'card_design'`).
|
|
263
|
+
|
|
264
|
+
### 5.5 Tabs & Accordions Color Codes + Active Bottom Line Styling (`tab` & `accordion`)
|
|
265
|
+
Both `tab` and `accordion` widgets support full theme token (`var(--ci-color-*)`) and custom `<CIColorField />` (`#HEX` + `RGB/RGBA`) styling:
|
|
266
|
+
- **Header & Content Colors:** `headerBgColor`, `headerTextColor` (`fontColor`), `activeBgColor`, `activeTextColor` (`activeColor`), `borderColor`, `contentBgColor`, and `contentTextColor`.
|
|
267
|
+
- **Active Tab Bottom Indicator Line & Active Accordion Accent Bar:** Configure `indicatorColor` (active tab underline slider `.v-tab__slider` / `.el-tabs__active-bar` and open accordion header bottom accent border) and `indicatorHeight` (`2px`–`8px`), plus optional per-item `header.color` and `header.textColor` overrides.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 6. Enterprise Survey & Poll Module (`survey`) + Strapi Analytics Hub
|
|
272
|
+
|
|
273
|
+
The **`survey`** widget provides a full-featured survey, NPS, and quick-poll platform with native Strapi reporting, statistical breakdowns, and anti-duplicate voting controls.
|
|
274
|
+
|
|
275
|
+
### 5.1 Three Display Modes (`displayMode`)
|
|
276
|
+
1. **`quick_poll` (Quick Poll):** Compact single-card poll for 1-click voting and instant live `%` bar feedback.
|
|
277
|
+
2. **`single_page` (Single-Page Survey):** Classic multi-question vertical survey form on one page.
|
|
278
|
+
3. **`multi_step` (Multi-Step Wizard):** Typeform-style step-by-step wizard (`steps[]`) with animated progress bar, per-step validation before advancing, and Back/Next navigation.
|
|
279
|
+
|
|
280
|
+
### 5.2 Supported 13 Question & Item Types
|
|
281
|
+
| Question Type | Key Options & Capabilities | Analytics Visualization |
|
|
282
|
+
| :--- | :--- | :--- |
|
|
283
|
+
| `single_choice` | Canonical `option.id`, `i18n` `labels`, `allowOther`, `shuffleOptions` | Horizontal `%` bars + expandable `"Other"` text entries |
|
|
284
|
+
| `multiple_choice` | `minSelections`, `maxSelections`, `allowOther`, `shuffleOptions` | Multi-select `%` distribution bars + `"Other"` entries |
|
|
285
|
+
| `dropdown` | Searchable/clean select menu with localized `option.labels` | Horizontal `%` & count bars |
|
|
286
|
+
| `image_choice` | Visual cards backed by Strapi Media Library (`option.image`) | Visual option `%` distribution bars |
|
|
287
|
+
| `nps` | `0–10` Net Promoter Score scale with localized endpoint labels | **NPS Score Gauge (`-100..+100`)** + Promoters (`9–10`), Passives (`7–8`), Detractors (`0–6`) + `0..10` histogram |
|
|
288
|
+
| `star_rating` | `1–5` or `1–10` interactive star rating | Weighted average score (`★`) + per-score vertical histogram |
|
|
289
|
+
| `likert_scale` | `1–5` or `1–7` agreement scale with `lowLabel` / `highLabel` | Weighted average + distribution histogram |
|
|
290
|
+
| `matrix_single` | Evaluation table (`rows[] × columns[]`, 1 choice per row) | **Color-coded Matrix Heatmap Table** (`%` & count per cell) |
|
|
291
|
+
| `ranking` | Drag-and-drop + ↑/↓ priority ordering of items | **Borda Count Leaderboard** (Average Rank, `#1` votes, Borda score `%`) |
|
|
292
|
+
| `short_text` | Single-line open-ended input with `vee-validate` rules (`email`, `min`, `max`, etc.) | Searchable Open-Ended Response Feed with locale & timestamp |
|
|
293
|
+
| `long_text` | Multi-line open-ended feedback textarea with `vee-validate` rules | Searchable Open-Ended Response Feed (cross-linked with NPS score) |
|
|
294
|
+
| `consent` | Required GDPR / KVKK consent switch (`accepted`) | Acceptance count & `100%` compliance bar |
|
|
295
|
+
| `statement` | Rich informational callout / section intro block (no input required) | Informational separator |
|
|
296
|
+
|
|
297
|
+
### 5.3 Canonical Option IDs + Dynamic Strapi `i18n` Locales
|
|
298
|
+
Every choice option, matrix row/column, and ranking item uses an immutable `id` alongside a dynamic `labels` dictionary populated from Strapi's active `i18n` locales (`Settings -> Internationalization`):
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"id": "opt_ai_assistant",
|
|
302
|
+
"labels": {
|
|
303
|
+
"tr": "Yapay Zeka (AI) İçerik & SEO Asistanı",
|
|
304
|
+
"en": "AI Content & SEO Assistant",
|
|
305
|
+
"de": "KI-Inhalts- & SEO-Assistent"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
Votes are recorded against `opt_ai_assistant`, so responses submitted in Turkish, English, German, or any other Strapi locale automatically aggregate into a single unified analytics chart!
|
|
310
|
+
|
|
311
|
+
### 5.4 Conditional Skip / Display Logic (`conditions`)
|
|
312
|
+
Show or hide follow-up questions dynamically based on previous answers (e.g. reveal `"What is the #1 improvement we should make?"` only when `nps_score <= 6`):
|
|
313
|
+
- **Supported Operators:** `equals`, `not_equals`, `in`, `contains`, `gt`, `lt`, `gte`, `lte`, `is_answered` (`logicMode`: `'all'` AND / `'any'` OR).
|
|
314
|
+
- **Shared Client + Backend Engine (`surveyEngine.ts` & `surveyHelpers.ts`):** When a question is hidden by its condition, both `<CISurvey>` and `POST /api/content-input/surveys/:id/submit` automatically skip its `required` check so submissions never fail on hidden fields.
|
|
315
|
+
|
|
316
|
+
### 5.5 Lifecycle, Anti-Duplicate Voting & GDPR/KVKK Controls
|
|
317
|
+
- **Publication & Quotas:** `status` (`'draft' | 'published' | 'closed'`), `startsAt` / `endsAt` date window, and `quotaLimit` maximum response cap.
|
|
318
|
+
- **Submission Policies (`submissionPolicy`):**
|
|
319
|
+
- `'one_per_voter'`: Browser `localStorage` token + backend salted **`HMAC-SHA256(IP + User-Agent + voterToken)`** check (returns **HTTP `409`** `{ alreadyVoted: true }` on duplicate attempts).
|
|
320
|
+
- `'one_per_token'`: Single vote per invited campaign/member token.
|
|
321
|
+
- `'unlimited'`: Unlimited kiosk/feedback submissions.
|
|
322
|
+
- **Privacy & Bot Protection:** `anonymizeIp: true` (never persists raw IP addresses in `ci_survey_responses`), hidden `_hp` honeypot field, optional Google reCAPTCHA v2 (`useRecaptcha`), and `showPublicResults` (`'never' | 'after_vote' | 'always'`).
|
|
323
|
+
|
|
324
|
+
### 5.6 Strapi Reporting & Analytics Hub + Excel CSV / JSON Export
|
|
325
|
+
Reporting is available in **two places** inside Strapi Admin:
|
|
326
|
+
1. **Dedicated Left Sidebar Menu (`Surveys & Forms` -> `/admin/plugins/content-input`):**
|
|
327
|
+
- Global dashboard for all surveys, polls, and dynamic form submissions.
|
|
328
|
+
- **4 KPI Cards:** Total Responses & Quota progress, Average & Median Completion Time (`durationMs`), Net Promoter Score (`-100..+100`) stacked bar, and Locale breakdown.
|
|
329
|
+
- **30-Day Daily Participation Trend** bar chart + Date Range (`from`/`to`) & `Locale` filters.
|
|
330
|
+
- **1-Click Export:** UTF-8 BOM `.csv` (opens directly in Microsoft Excel with Turkish/Unicode characters intact) and structured `.json` export (`GET /content-input/surveys/:id/export?format=csv|json`).
|
|
331
|
+
2. **Inline `Survey Studio Modal` -> `Tab 4: Analytics & Reports`:** View live charts for the selected survey directly inside the Content Manager page editor.
|
|
332
|
+
3. **Rich Seed Dataset Included in Playground (`525` Responses):** Boots automatically with 3 realistic showcase surveys (`showcase_dx_survey` with `185` correlated 30-day responses, `showcase_roadmap_poll` with `245` votes, and `showcase_visual_theme_poll` with `95` votes) plus `20` sample corporate form submissions.
|
|
110
333
|
|
|
111
334
|
---
|
|
112
335
|
|
|
113
|
-
##
|
|
336
|
+
## 7. Component Map Keys (`widget.id`) & Reference Table (All 18 Widgets)
|
|
114
337
|
|
|
115
|
-
All
|
|
338
|
+
All 18 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`):
|
|
116
339
|
|
|
117
340
|
| Component Map Key (`widget.id`) | Category | `slotContext` Helper Property | Description & Supported Scenarios |
|
|
118
341
|
| :--- | :--- | :--- | :--- |
|
|
342
|
+
| `heroSlider` | Media & Visuals | `widget.data`, `widget.options` | Homepage multi-layer **Swiper.js** hero banner (`CIHeroSlider`) with mouse drag-to-slide (`effect: 'slide'` default + `fade`/`creative`/`coverflow`/`cube`/`flip`), Ken Burns motion, Parallax layers (`badge`, `heading`, `subtitle`, `buttons`, `floating_image`, `stats`), and 7 typographic effects (`typewriter`, `gradient_text`, `rotating_words`, `highlight_marker`, `outline_stroke`, `glow`). |
|
|
343
|
+
| `dataTable` | Dynamic & Modules | `widget.data`, `widget.options` | Interactive **Data Table** (`CIDataTable`) supporting `.xlsx`/`.xls`/`.csv` file upload, Excel/CSV paste & live Strapi Collection (`GET /api/content-input/data-table`) with selectable fields, fixed/sticky header + X/Y scroll (`maxHeight`, `minTableWidth`, `stickyFirstColumn`), 9 column types, search, sorting, filter chips, pagination, summary row (`SUM`/`AVG`/`COUNT`), and CSV export. |
|
|
344
|
+
| `customCard` | Dynamic & Modules | `widget.data`, `widget.options` | **Custom Card Designer** (`CICustomCard`) with 6 archetypes (`feature`, `pricing` with ribbon & checklist, `testimonial` with stars, `profile`, `stat`, `overlay_story`), `heightMode` (`equal`/`fixed`/`auto`), per-card `accentOverride`, saved card design presets, Color Codes bindings, and `swiper` / `grid` / `single` display modes. |
|
|
345
|
+
| `entityCard` | Dynamic & Modules | `entityCardData` (`NormalizedEntityCardData`) | Linked Strapi entity card(s) supporting `'single'`, `'swiper'` (**Swiper.js Carousel**), and `'grid'` modes, `heightMode` (`equal`/`fixed`/`auto`), multi-entity `items[]` or automatic `collectionFeed`, field inheritance + per-card `accentColor` & manual overrides, and Color Codes `cardProps`. |
|
|
119
346
|
| `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. |
|
|
347
|
+
| `heading` | Content & Typography | `headingData` (`{ text, tag, align, color, fontSize, fontWeight }`) | Semantic heading (`h1`–`h6`) with alignment (`left`, `center`, `right`), Color Codes / HEX / RGBA color, font size, and weight. |
|
|
348
|
+
| `button` | Interactive & Navigation | `buttonData` (`{ label, url, target, variant, size, align }`) | CTA button supporting `primary`, `secondary`, `outline`, `ghost` variants, custom Color Codes tokens, and `sm`, `md`, `lg` sizes. |
|
|
122
349
|
| `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. |
|
|
350
|
+
| `spacer` | Layout | `widget.data` (`{ height, divider, dividerColor, lineWidth }`) | Configurable vertical space (`height` in `px`) with optional Color Codes horizontal divider line. |
|
|
124
351
|
| `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
352
|
| `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`)
|
|
127
|
-
| `accordion` | Interactive & Navigation | `tabAccItems` (`NormalizedTabAccItem[]`) | Single or multi-open (`options.multiple`) accordion panels with
|
|
353
|
+
| `tab` | Interactive & Navigation | `tabAccItems` (`NormalizedTabAccItem[]`) | Horizontal or vertical tabs (`options.vertical`, `options.grow`) with Color Codes & `<CIColorField />` styling (`headerBgColor`, `headerTextColor`, `activeBgColor`, `activeTextColor`, active bottom line `indicatorColor` & `indicatorHeight`), Rich HTML (`contentMode: 'text'`), and recursive nested `ContentInput` rows (`contentMode: 'builder'`). |
|
|
354
|
+
| `accordion` | Interactive & Navigation | `tabAccItems` (`NormalizedTabAccItem[]`) | Single or multi-open (`options.multiple`) accordion panels with Color Codes & `<CIColorField />` styling (`headerBgColor`, `headerTextColor`, `activeBgColor`, `activeTextColor`, active bottom accent `indicatorColor`, per-node `header.color` / `header.textColor`), Rich HTML, and nested `ContentInput` rows. |
|
|
128
355
|
| `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
|
|
356
|
+
| `contentForm` | Dynamic & Modules | `formData`, `submitForm` | Async DB-backed dynamic form (`CIDynamicForm`) with 9 field types, dynamic Strapi `i18n` locales, shared client+server `vee-validate` rules, Google reCAPTCHA v2, Mailtrap/Mailgun/SMTP delivery, and `@submit-form` event. |
|
|
357
|
+
| `survey` | Dynamic & Modules | `surveyData`, `submitSurvey` | Enterprise Survey & Quick Poll (`CISurvey`) supporting `quick_poll`, `single_page`, and `multi_step` wizard modes, 13 question types (NPS, Star, Likert, Matrix, Borda Ranking, Image Choice, etc.), conditional skip logic, HMAC duplicate protection, live `%` results, and `@submit-survey` event. |
|
|
130
358
|
| `iframe` | Media & Visuals | `widget.data` (`string` or `{ url, height }`) | Embedded iframe (OpenStreetMap, Google Maps, external embeds) with configurable height. |
|
|
131
359
|
| `banner` | Media & Visuals | `widget.data` (`{ banner: { id, name } }`) | Campaign / promotional banner widget designed to be easily customized via slots or `:components`. |
|
|
132
360
|
|
|
133
361
|
---
|
|
134
362
|
|
|
135
|
-
##
|
|
363
|
+
## 8. Storefront Customization & Theme Props Guide (Nuxt Vuetify & Element Plus)
|
|
364
|
+
|
|
365
|
+
`<ContentInputPreview>` automatically fetches the active **Color Codes** palette (`GET ${baseUrl}/api/content-input/color-codes`) and binds `--ci-color-*` CSS variables on its root wrapper. You can also pass `:theme-slug="'emerald-fintech'"` or `:color-variables="{ '--ci-color-primary': '#059669' }"` to switch themes dynamically at runtime.
|
|
136
366
|
|
|
137
367
|
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:
|
|
138
368
|
|
|
@@ -142,12 +372,12 @@ Override individual widgets inline while keeping the responsive 12-column grid a
|
|
|
142
372
|
```vue
|
|
143
373
|
<template>
|
|
144
374
|
<ContentInputPreview :model-value="page.content" base-url="http://localhost:1337">
|
|
145
|
-
<template #widget-
|
|
146
|
-
<
|
|
375
|
+
<template #widget-entityCard="{ entityCardData }">
|
|
376
|
+
<MyCustomEntityCard :card="entityCardData" />
|
|
147
377
|
</template>
|
|
148
378
|
|
|
149
|
-
<template #widget-
|
|
150
|
-
<
|
|
379
|
+
<template #widget-banner="{ data, options }">
|
|
380
|
+
<MyCustomBanner :banner="data?.banner" :options="options" />
|
|
151
381
|
</template>
|
|
152
382
|
</ContentInputPreview>
|
|
153
383
|
</template>
|
|
@@ -162,8 +392,8 @@ Pass an object mapping any `widget.id` key from the table above to your own Vue
|
|
|
162
392
|
:model-value="page.content"
|
|
163
393
|
base-url="http://localhost:1337"
|
|
164
394
|
:components="{
|
|
395
|
+
entityCard: MyCustomEntityCard,
|
|
165
396
|
banner: MyCustomBanner,
|
|
166
|
-
contentForm: MyCustomContactForm,
|
|
167
397
|
youtubeVideo: MyCustomVideoPlayer,
|
|
168
398
|
}"
|
|
169
399
|
/>
|
|
@@ -171,7 +401,7 @@ Pass an object mapping any `widget.id` key from the table above to your own Vue
|
|
|
171
401
|
```
|
|
172
402
|
|
|
173
403
|
### 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:
|
|
404
|
+
Copy the entire set of Vue SFC templates (`ContentInputPreview.vue`, `CIRow.vue`, `CIBlock.vue`, `CIWidget.vue`, `CISwiperNavButtons.vue`, `CIHeroSlider.vue`, `CIDataTable.vue`, `CICustomCard.vue`, `CIDynamicForm.vue`, `CISurvey.vue`) and utilities (`utils/helpers.ts`, `utils/colorCodes.ts`, `utils/formValidation.ts`, `utils/surveyHelpers.ts`) directly into your project so you can edit every line of template/CSS freely:
|
|
175
405
|
|
|
176
406
|
```bash
|
|
177
407
|
# For Nuxt + Vuetify projects:
|
|
@@ -184,21 +414,6 @@ npx strapi-content-input-ep eject ./components/content-input
|
|
|
184
414
|
npx strapi-content-input-vuetify eject ./components/content-input --force
|
|
185
415
|
```
|
|
186
416
|
|
|
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
|
-
```
|
|
201
|
-
|
|
202
417
|
---
|
|
203
418
|
---
|
|
204
419
|
|
|
@@ -206,7 +421,7 @@ npx strapi-content-input-vuetify eject ./components/content-input --force
|
|
|
206
421
|
|
|
207
422
|
## 1. Mevcut Bir Strapi v5 Projesine Kurulum ve Entegrasyon
|
|
208
423
|
|
|
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.
|
|
424
|
+
`@ozguraltan/strapi-content-input`, gelişmiş **ContentInput** görsel sayfa/içerik tasarım motorunu (**18 yerleşik bileşen**), **Hero Slider**, **Veri Tabloları (`dataTable`)**, **Özel Kart Tasarımcısı (`customCard`)**, **Color Codes Tema Motorunu (`HEX` + `RGB/RGBA` + `--ci-color-*`)**, **Dinamik Form Stüdyosunu (`contentForm`)** ve **Kurumsal Anket & Raporlama Merkezini (`survey`)** **Strapi v5** ekosistemine yerel bir `json` (`PostgreSQL JSONB`) özel alanı (**Custom Field**) olarak taşır.
|
|
210
425
|
|
|
211
426
|
### Adım 1: Paketi Strapi Projenize Çekin
|
|
212
427
|
```bash
|
|
@@ -215,8 +430,9 @@ npm install @ozguraltan/strapi-content-input
|
|
|
215
430
|
npm install git+ssh://git@gitlab.com:ozguraltan/strapi-content-input.git
|
|
216
431
|
```
|
|
217
432
|
|
|
218
|
-
### Adım 2: `config/plugins.ts` İçinde Etkinleştirin
|
|
433
|
+
### Adım 2: `config/plugins.ts` ve `config/features.ts` İçinde Etkinleştirin
|
|
219
434
|
```ts
|
|
435
|
+
// config/plugins.ts
|
|
220
436
|
export default () => ({
|
|
221
437
|
'content-input': {
|
|
222
438
|
enabled: true,
|
|
@@ -224,6 +440,14 @@ export default () => ({
|
|
|
224
440
|
});
|
|
225
441
|
```
|
|
226
442
|
|
|
443
|
+
**Strapi v5.61+** sürümlerinde tüm ContentInput bileşenlerinde ve tam ekran stüdyolarda Strapi'nin kendi tam özellikli **Medya Kütüphanesi Modalının** (küçük resimler/thumbnails, sayfalama, klasör yönetimi, çoklu yükleme ve dahili kırpma/crop aracı ile) açılması için `config/features.ts` dosyasına `useLegacyMediaLibrary: true` ekleyin:
|
|
444
|
+
```ts
|
|
445
|
+
// config/features.ts
|
|
446
|
+
export default () => ({
|
|
447
|
+
useLegacyMediaLibrary: true,
|
|
448
|
+
});
|
|
449
|
+
```
|
|
450
|
+
|
|
227
451
|
### Adım 3: `schema.json` İçine Custom Field Olarak Ekleyin
|
|
228
452
|
```json
|
|
229
453
|
{
|
|
@@ -242,47 +466,131 @@ export default () => ({
|
|
|
242
466
|
|
|
243
467
|
---
|
|
244
468
|
|
|
245
|
-
## 2.
|
|
469
|
+
## 2. Dinamik Form Oluşturucu (`contentForm`), Validasyon Kuralları, reCAPTCHA v2 ve Mail Gönderimi
|
|
470
|
+
|
|
471
|
+
`cms-core` mimarisinden ilham alınarak geliştirilen `contentForm` bileşeni, veritabanı tabanlı form yönetimi, hem önyüzde hem sunucuda çalışan ortak validasyon motoru, Google reCAPTCHA v2 ve 3. parti e-posta servislerini barındırır:
|
|
472
|
+
|
|
473
|
+
1. **Veritabanı Kaydı, Tam Sürükle-Bırak Form Stüdyosu ve Asenkron Yükleme:**
|
|
474
|
+
- Form şablonları PostgreSQL üzerinde `ci_forms` (`plugin::content-input.ci-form`) tablosunda tutulur; gönderilen başvurular ise IP adresi, User-Agent ve mail gönderim durumu ile birlikte `ci_form_submissions` tablosuna kaydedilir.
|
|
475
|
+
- **Tam Sürükle & Bırak (Drag & Drop) ve Dinamik Strapi `i18n` Dil Desteği:** Form Stüdyosu içerisindeki Hızlı Alan Şablonları, Satır Şablonları (`12`, `6+6`, `4+4+4`, `8+4`), Satırlar, Sütunlar (satır içi ve satırlar arası), Yerleşmiş/Yerleşmemiş Form Alanları, Çoklu Seçenek satırları ve Aktif Validasyon Kuralı rozetlerinin tamamı sürükle-bırak ile taşınabilir. Seçenek etiketleri (`selectGroup`, `radioGroup`, `checkboxGroup`), alan başlıkları ve ipuçları Strapi **Internationalization (`i18n`)** eklentisinde tanımlı aktif dillerden (`GET /content-input/locales` — örn. `tr`, `en`, `de`, `fr`, `ar`) dinamik olarak beslenir.
|
|
476
|
+
- Nuxt Vuetify ve Element Plus paketlerindeki `<CIDynamicForm>` bileşeni, form şemasını `GET ${baseUrl}/api/content-input/forms/:id` uç noktasından asenkron olarak çeker (API anahtarları ve gizli bilgiler yanıt içinden otomatik temizlenir).
|
|
477
|
+
- 12 sütunlu duyarlı (responsive) form ızgarası içinde **9 alan tipini** destekler: `input` (Metin), `emailInput` (E-Posta), `telInput` (Telefon), `numeric` (Sayısal), `textArea` (Çok Satırlı Metin), `selectGroup` (Açılır Liste), `radioGroup` (Tekli Seçim), `checkboxGroup` (Çoklu Seçim), `switchBox` (KVKK / Onay Kutusu).
|
|
478
|
+
2. **Hem Önyüzde Hem Backend'de Çalışan `vee-validate` Tarzı Validasyon Kuralları:**
|
|
479
|
+
- Kurallar `|` karakteri ile birleştirilir (Örn: `required|email|max:120` veya `required|min:10|max:1000`).
|
|
480
|
+
- Gönderim anında `POST ${baseUrl}/api/content-input/forms/:id/submit` uç noktasında aynı kurallar tekrar çalıştırılır; hata varsa **HTTP `422`** koduyla alan bazlı Türkçe/İngilizce hata mesajları döner:
|
|
481
|
+
|
|
482
|
+
| Kural | Örnek Kullanım | Açıklama |
|
|
483
|
+
| :--- | :--- | :--- |
|
|
484
|
+
| `required` | `required` | Alan boş bırakılamaz. |
|
|
485
|
+
| `accepted` | `accepted` | Onay kutusu (`switchBox`) işaretlenmelidir (`true` / `1` / `on`). |
|
|
486
|
+
| `email` | `required\|email` | Geçerli e-posta adresi formatı kontrolü. |
|
|
487
|
+
| `phone` | `phone` | Telefon numarası formatı kontrolü (en az 7 rakam). |
|
|
488
|
+
| `url` | `url` | Geçerli `http://` veya `https://` web adresi. |
|
|
489
|
+
| `numeric` / `integer` | `required\|numeric` | Sayısal veya tam sayı değer kontrolü. |
|
|
490
|
+
| `min:<n>` / `max:<n>` | `required\|min:3\|max:100` | Minimum / maksimum karakter sayısı (veya `checkboxGroup` için seçim adedi). |
|
|
491
|
+
| `min_value:<n>` / `max_value:<n>` | `numeric\|min_value:1` | Sayısal alt ve üst sınır kontrolü. |
|
|
492
|
+
| `between:<min>,<max>` | `numeric\|between:1,100` | Belirtilen aralıkta olma zorunluluğu. |
|
|
493
|
+
| `alpha` / `alpha_num` | `alpha_num` | Yalnızca harf veya harf+rakam (Türkçe karakter destekli). |
|
|
494
|
+
| `in:<a,b,c>` | `required\|in:Satış,Destek` | İzin verilen değerlerden biri olma zorunluluğu. |
|
|
495
|
+
| `regex:<desen>` | `regex:^[A-Z0-9-]+$` | Özel düzenli ifade (RegExp) doğrulaması. |
|
|
496
|
+
| `confirmed:<alan>` | `confirmed:email` | Başka bir alanla birebir eşleşme kontrolü. |
|
|
497
|
+
|
|
498
|
+
3. **Google reCAPTCHA v2 ve 3. Parti Mail Servisleri (`Mailtrap`, `Mailgun`, `SMTP`):**
|
|
499
|
+
- Ortam değişkenlerinde (`.env`) `MIX_RECAPTCHA_PUBLIC_KEY` (veya form özelinde `recaptchaSiteKey`) tanımlıysa formun altında otomatik olarak Google reCAPTCHA v2 kutusu render edilir ve sunucuda `RECAPTCHA_PRIVATE_KEY` ile doğrulanır.
|
|
500
|
+
- Mail gönderimi için hem `.env` üzerinden (`MAIL_DRIVER=mailtrap|mailgun|smtp|strapi`, `MAILTRAP_API_TOKEN`, `MAILTRAP_INBOX_ID`, `MAILGUN_SECRET`, `MAILGUN_DOMAIN`, `MAIL_HOST`, `MAIL_PORT`, `MAIL_USERNAME`, `MAIL_PASSWORD`) hem de Strapi Form Stüdyosu içindeki **2. Sekme (Mail & reCAPTCHA)** üzerinden form bazlı API Key tanımlanabilir.
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## 3. Bağlı İçerik Kartı (`entityCard`) — Tekli Kart, Swiper.js Carousel, Grid ve Otomatik Koleksiyon Akışı
|
|
246
505
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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.
|
|
506
|
+
**`entityCard`** bileşeni herhangi bir Strapi içerik kaydına (`api::page.page`, makale, ürün vb.) bağlanır ve **3 farklı görünüm modunu** destekler:
|
|
507
|
+
- **Görünüm Modları (`options.displayMode`):** `'single'` (tek kart), `'swiper'` (resmi **Swiper.js Carousel** — `slidesPerView`, `spaceBetween`, `loop`, `autoplay`, `navigation`, `pagination`, `mousewheel`, `coverflow`/`cards` efektleri) ve `'grid'` (çok sütunlu duyarlı ızgara).
|
|
508
|
+
- **Çoklu Seçim (`items[]`) veya Otomatik Koleksiyon Akışı (`collectionFeed`):** Birden fazla Strapi kaydını elle seçip sıralayabilir veya bir Strapi koleksiyonundaki son `N` yayını (`GET /api/content-input/entity-cards`) otomatik olarak Swiper Carousel / Grid içinde listeleyebilirsiniz.
|
|
509
|
+
- **Otomatik Miras (Fallback), Kart Bazlı Accent Renk & Manuel Ezme (Override):** Editör kart üzerindeki Başlık (`title`), Alt Başlık (`subtitle`), Açıklama (`description`), Görsel (`image`), Rozet (`badgeText`), Link (`url`) veya kart bazlı Vurgu Rengi (`accentColor`) alanlarını boş bıraktığında bu bilgiler otomatik olarak bağlı Strapi kaydından/genel kart ayarından çekilir; doldurulan alanlar ise o kart özelinde ezilir.
|
|
510
|
+
- **Kart Carousel Düşey Yükseklik Eşitleme (`options.heightMode` & `options.cardHeight`):** Metin satır sayısı farklı olsa bile kartların boyunun kısalmaması için `'equal'` (varsayılan — en yüksek karta eşitler ve alt butonları aynı hizada sabitler), `'fixed'` (`cardHeight` piksel sabit yükseklik) ve `'auto'` seçeneklerini sunar.
|
|
511
|
+
- **Vuetify & Element Plus Kart Propları ve Color Codes (`options.cardProps`):** `layout` (`vertical`, `horizontal`, `overlay`), `variant` (`elevated`, `outlined`, `flat`, `tonal`), `elevation` (`0`–`24`), `rounded`, `color`, `textColor`, `accentColor` (Color Codes token destekli), `imageHeight`, `showBadge`, `showButton`, `buttonVariant`, `hoverEffect`.
|
|
512
|
+
- **Dışarıdan Tam Özelleştirme:** `#widget-entityCard="{ entityCardData }"` slotu veya `:components="{ entityCard: BenimKartBilesenim }"` prop'u ile tamamen kendi kart tasarımınızı kullanabilirsiniz.
|
|
255
513
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
514
|
+
---
|
|
515
|
+
|
|
516
|
+
## 4. Color Codes Tema Motoru, Hero Slider, Veri Tabloları ve Özel Kart Tasarımcısı
|
|
517
|
+
|
|
518
|
+
1. **Color Codes Tema Renk Yönetimi (`HEX` + `RGB/RGBA` + Görsel Spektrum + `--ci-color-*`):**
|
|
519
|
+
- Hem Strapi Sol Menüsündeki **Surveys, Forms & Colors -> Color Codes** sekmesinden hem de Görsel Editör üst çubuğundaki **🎨 Color Codes** butonundan yönetilir.
|
|
520
|
+
- `primary`, `secondary`, `accent`, `success`, `warning`, `error`, `info`, `surface`, `surfaceAlt`, `background`, `textPrimary`, `textSecondary`, `border` semantik renklerinin yanı sıra sınırsız sayıda özel marka rengi tanımlanabilir.
|
|
521
|
+
- Tüm renk alanlarında (`<CIColorField />`) **2D Görsel Renk Seçici**, doğrudan **`#HEX` (`#RRGGBB` / `#RRGGBBAA`)** girişi, sayısal **`RGB / RGBA` (`R`, `G`, `B`, `A%`)** kutuları + `rgb(...)`/`rgba(...)` metin girişi ve **"+ Bu Rengi Color Codes'a Kaydet"** özelliği bulunur. Aktif palet değiştiğinde bağlı tüm bileşenler (`var(--ci-color-primary, ...)`) sayfaları tek tek düzenlemeye gerek kalmadan anında güncellenir!
|
|
522
|
+
2. **Hero Slider (`heroSlider` — Ölçekli Canlı Stüdyo, Serbest X/Y Katmanlar, 19+ Özel En-Boy Oranı ve Mobil Portrait Modu):**
|
|
523
|
+
- **Ölçekli Gerçek Viewport Sahnesi (`1280px` / `768px` / `390px` Mobil Portrait) ve Canlı Efekt Oynatımı:** Modal stüdyoda slaytları sıkıştırmak yerine gerçek hedef ekran genişliklerinde (`Fit`, `%50`, `%75`, `%100`, `# Grid`, `⤢ Zen`) ölçekleyerek birebir vitrin görünümüyle önizler; `◀ ▶`, `↻ Efektleri Oynat` ve `▶ Auto` ile tüm Swiper geçişlerini (`slide`, `fade`, `creative`, `coverflow`, `cube`, `flip`), Ken Burns ve tipografik efektleri canlı çalıştırır.
|
|
524
|
+
- **Serbest Katman Konumlandırma (`X, Y, Width, Height, Z-Index`):** Katmanları `Akış (Flow)` veya `Serbest (Free)` modda konumlandırın; sahne üzerinde fare ile sürükleyip 8 tutamaçla boyutlandırın, 9 noktalı hızlı hizalama matrisini kullanın ve masaüstü/tablet/mobil için ayrı kutu koordinatları (`box`, `boxTablet`, `boxMobile`) ve font boyutları tanımlayın.
|
|
525
|
+
- **19 Yaygın Aspect Ratio + Manuel Özel Oran (`W : H` / Piksel):** `4:1`'den `9:21`'e kadar kategorize 19 hazır en-boy oranı seçeneğinin yanı sıra `1920:680`, `2.35:1` gibi serbest manuel oran girişi hem Hero Slider (cihaz ve slayt bazlı) hem Galeri bileşeninde desteklenir.
|
|
526
|
+
- **Mobil Portrait Özel Slaytlar:** Cihaz bazlı slayt görünürlüğü (`all`, `desktop_tablet`, `mobile_only`, `desktop_only`, `tablet_only`), tek tıkla **"📱 Mobil Portrait Kopyası Türet"** aksiyonu ve mobil cihaza özel arka plan görseli/videosu (`mobileBgType` / `mobileBgImage`) ezme desteği sunar.
|
|
527
|
+
3. **Veri Tabloları (`dataTable`):**
|
|
528
|
+
- **Excel (`.xlsx`, `.xls`) ve CSV (`.csv`, `.tsv`) Dosya Yükleme (Upload / Sürükle-Bırak)** (`xlsx` çoklu sayfa/sheet seçici ile), panodan yapıştırma (`manual`) veya **Canlı Strapi Koleksiyonu (`strapi_collection` -> `/api/content-input/data-table`)** veri kaynağıyla çalışır.
|
|
529
|
+
- Strapi koleksiyonu seçildiğinde koleksiyondaki **hangi alanların tabloya geleceği (`availableFields`)** onay kutularıyla seçilebilir ve sütun sırası/başlıkları özelleştirilebilir.
|
|
530
|
+
- **Sabit Tablo Başlığı (`stickyHeader`) + Yatay ve Düşey Scroll:** Düşey kaydırma (`verticalScroll` + `maxHeight`), yatay kaydırma (`horizontalScroll` + `minTableWidth`) ve ilk sütunu sabitleme (`stickyFirstColumn`) seçeneklerini destekler.
|
|
531
|
+
- `text`, `number`, `currency`, `progress` (yüzde çubuğu), `badge` (Color Codes rozetleri), `boolean`, `image` (tıklayınca büyüyen Lightbox), `date`, `link` hücre tiplerini; canlı arama, sütun sıralama, hızlı filtre çiplerini, sayfalamayı, alt toplam (`SUM`/`AVG`/`COUNT`) satırını ve ziyaretçi **CSV indirme** butonunu destekler.
|
|
532
|
+
4. **Özel Kart Tasarımcısı (`customCard`):**
|
|
533
|
+
- **6 Hazır Kart Arketipi:** `feature` (Özellik/Hizmet), `pricing` (`"EN POPÜLER"` şeritli ve `✓` maddeli Fiyat Paketi), `testimonial` (5 yıldızlı Müşteri Yorumu), `profile` (Ekip Kartı), `stat` (KPI İstatistik Kartı), `overlay_story` (Görsel Üzeri Hikaye Kartı).
|
|
534
|
+
- **Düşey Yükseklik Eşitleme & Kart Bazlı Accent Renk:** `heightMode: 'equal' | 'fixed' | 'auto'` (`cardHeight` px) ile metin satır sayısına göre kartların kısalmasını engeller (en yüksek karta eşitler veya sabit yükseklik verir) ve her kart öğesi için ayrı **`accentOverride`** rengi seçilmesine olanak tanır.
|
|
535
|
+
- Köşe yuvarlatma, gölge/glassmorphism, hover efektleri (`lift`, `glow`, `scale`, `border-accent`), Color Codes bağlantıları ve tek tıkla **Kayıtlı Kart Tasarım Şablonu (`card_design`)** kaydetme/yükleme özellikleriyle birlikte `swiper` (Carousel), `grid` veya `single` olarak sergilenir.
|
|
536
|
+
5. **Sekme (`tab`) ve Akordiyon (`accordion`) Color Codes & Renk Seçici Desteği:**
|
|
537
|
+
- Sekme ve akordiyon bileşenlerinde arka plan rengi (`headerBgColor`, `contentBgColor`), yazı rengi (`headerTextColor`, `contentTextColor`), aktif sekme/panel rengi (`activeBgColor`, `activeTextColor`) ve **aktif olan sekmenin altındaki çizgi rengi (`indicatorColor`) ile kalınlığı (`indicatorHeight`)** hem Color Codes token'ları hem de `#HEX` / `RGB/RGBA` renk seçici (`<CIColorField />`) ile düzenlenebilir.
|
|
260
538
|
|
|
261
539
|
---
|
|
262
540
|
|
|
263
|
-
##
|
|
541
|
+
## 5. Kurumsal Anket & Oylama Modülü (`survey`) ve Strapi Raporlama Merkezi
|
|
542
|
+
|
|
543
|
+
**`survey`** bileşeni; tek tıkla hızlı oylamalardan çok adımlı (Typeform tarzı) kurumsal anketlere, koşullu soru mantığından Strapi içi görsel analitik ve Excel dışa aktarımına kadar uçtan uca bir anket altyapısı sunar:
|
|
544
|
+
|
|
545
|
+
1. **3 Farklı Görünüm Modu (`displayMode`):**
|
|
546
|
+
- `quick_poll`: Tek kartta hızlı oylama ve oy sonrası anlık `%` çubuk grafiği.
|
|
547
|
+
- `single_page`: Tüm soruların tek sayfada alt alta yer aldığı klasik anket düzeni.
|
|
548
|
+
- `multi_step`: Adım çubuklu, ilerleme yüzdeli, her adımda validasyon yapan **Çok Adımlı Sihirbaz (Wizard)** modu.
|
|
549
|
+
2. **13 Soru ve Öğe Tipi:**
|
|
550
|
+
- Seçimli tipler: `single_choice` (Tekli Seçim + `"Diğer"` açık uçlu seçenek + şık karıştırma), `multiple_choice` (Çoklu Seçim + `minSelections`/`maxSelections`), `dropdown` (Açılır Liste), `image_choice` (Strapi Medya Kütüphanesi görselli kart seçimi).
|
|
551
|
+
- Ölçek, Matris ve Sıralama: `nps` (`0–10` Net Promoter Score), `star_rating` (`1–5` / `1–10` Yıldız), `likert_scale` (`1–5` / `1–7` Katılım Ölçeği), `matrix_single` (Satır × Sütun değerlendirme tablosu), `ranking` (Sürükle-bırak öncelik sıralama ve **Borda Puanlama**).
|
|
552
|
+
- Metin, Onay ve Bilgi: `short_text`, `long_text` (`vee-validate` kurallı), `consent` (KVKK/GDPR onayı) ve `statement` (bilgi/bölüm açıklaması).
|
|
553
|
+
3. **Sabit Seçenek Kimliği (`option.id`) + Dinamik Strapi `i18n` Etiketleri:**
|
|
554
|
+
- Seçenekler sabit bir `id` (`"opt_ai"`) ve Strapi `i18n` dillerine göre dinamik `labels` (`{ tr: "...", en: "...", de: "..." }`) sözlüğü ile saklanır. Böylece farklı dillerde verilen tüm oylar raporlama ekranında tek bir grafik çubuğunda birleşir.
|
|
555
|
+
4. **Koşullu Soru Gösterimi (`conditions` / Skip Logic):**
|
|
556
|
+
- Önceki sorulara verilen yanıtlara göre (`equals`, `not_equals`, `in`, `contains`, `gt`, `lt`, `gte`, `lte`, `is_answered`) takip sorularını dinamik olarak gösterir veya gizler (Örn: `nps_score <= 6` ise *"Geliştirmemiz gereken en kritik nokta nedir?"* sorusunun açılması). Gizlenen zorunlu sorular hem Nuxt önyüzünde hem Strapi sunucu validasyonunda (`HTTP 422`) otomatik atlanır.
|
|
557
|
+
5. **Mükerrer Oy Engelleme, Kota & KVKK/GDPR Güvenliği:**
|
|
558
|
+
- `status` (`draft` / `published` / `closed`), başlangıç/bitiş tarihi (`startsAt`/`endsAt`), maksimum yanıt kotası (`quotaLimit`).
|
|
559
|
+
- `submissionPolicy`: `'one_per_voter'` (`localStorage` + sunucuda tuzlanmış **`HMAC-SHA256(IP + User-Agent + voterToken)`** kontrolü ile mükerrer oyda `HTTP 409`), `'one_per_token'` veya `'unlimited'`.
|
|
560
|
+
- `anonymizeIp: true` ile ham IP kaydetmeden anonim parmak izi üretimi, `_hp` honeypot, isteğe bağlı Google reCAPTCHA v2 ve katılımcılara canlı sonuç gösterimi (`showPublicResults`: `'never' | 'after_vote' | 'always'`).
|
|
561
|
+
6. **Strapi Sol Menü "Surveys & Forms" Raporlama Merkezi (`/admin/plugins/content-input`):**
|
|
562
|
+
- Hem Strapi sol menüsündeki bağımsız **Surveys & Forms** sayfasından hem de **Anket Stüdyosu -> Raporlama & Analiz** sekmesinden erişilebilir.
|
|
563
|
+
- Toplam yanıt & kota doluluk oranı, ortalama/medyan tamamlama süresi, **NPS Skoru (`-100..+100` — Destekçiler / Pasifler / Eleştirenler)**, **30 Günlük Katılım Trendi**, Matris **Isı Haritası (Heatmap)**, Borda Sıralama Liderlik Tablosu, aranabilir açık uçlu yanıt listesi, Tarih & Dil filtreleri ve tek tıkla **Excel uyumlu UTF-8 BOM `.csv` / `.json`** indirme özelliklerini içerir.
|
|
564
|
+
- Playground ortamı **525 korelasyonlu örnek anket yanıtı** (`showcase_dx_survey`: `185`, `showcase_roadmap_poll`: `245`, `showcase_visual_theme_poll`: `95`) ve **20 örnek kurumsal form başvurusu** ile hazır gelir.
|
|
264
565
|
|
|
265
|
-
|
|
566
|
+
---
|
|
567
|
+
|
|
568
|
+
## 6. Bileşen Haritası Anahtarları (`widget.id` — Tüm 18 Bileşen)
|
|
266
569
|
|
|
267
570
|
| Anahtar (`widget.id`) | Etiket | `slotContext` Verisi | Açıklama |
|
|
268
571
|
| :--- | :--- | :--- | :--- |
|
|
572
|
+
| `heroSlider` | Hero Slider | `data`, `options` | Fare ile sürükle-bırak kaydırmalı (`slide` varsayılan) çok katmanlı **Swiper.js** ana sayfa banner alanı (`CIHeroSlider`), Ken Burns, Parallax ve 7 tipografik efekt (`typewriter`, `gradient_text`, `highlight_marker` vb.) |
|
|
573
|
+
| `dataTable` | Veri Tablosu | `data`, `options` | `.xlsx`/`.xls`/`.csv` dosya yükleme, yapıştırma veya alan seçilebilir canlı Strapi koleksiyon tablosu (`CIDataTable`); sabit başlık (`stickyHeader`), yatay/düşey scroll, ilk sütun sabitleme, 9 hücre formatı, arama, sıralama, filtre çipleri, alt toplam ve CSV indirme |
|
|
574
|
+
| `customCard` | Özel Kart Tasarımcısı | `data`, `options` | 6 arketipli (`feature`, `pricing`, `testimonial`, `profile`, `stat`, `overlay_story`) görsel kart stüdyosu (`CICustomCard`), düşey yükseklik eşitleme (`heightMode`), kart bazlı `accentOverride`, şablon kaydı ve `swiper` / `grid` / `single` gösterim |
|
|
575
|
+
| `entityCard` | İçerik Kartı / Carousel | `entityCardData` | Strapi kayıtlarından veri miras alan tekli kart, **Swiper.js Carousel (`swiper`)** veya `grid`; düşey yükseklik eşitleme (`heightMode`), kart bazlı `accentColor`, çoklu seçim (`items[]`) ve otomatik `collectionFeed` destekli |
|
|
269
576
|
| `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`
|
|
272
|
-
| `spacer` | Boşluk | `data` | Piksel yüksekliği ve isteğe bağlı ayırıcı çizgi (`divider: true`) |
|
|
577
|
+
| `heading` | Başlık | `headingData` | `H1`–`H6` seviye, hizalama, boyut ve Color Codes / HEX / RGBA renk seçenekli başlık |
|
|
578
|
+
| `button` | Buton | `buttonData` | `primary`, `secondary`, `outline`, `ghost` varyantlı, Color Codes renkli ve `sm`/`md`/`lg` boyutlu aksiyon butonu |
|
|
579
|
+
| `spacer` | Boşluk | `data` | Piksel yüksekliği ve isteğe bağlı Color Codes ayırıcı çizgi (`divider: true`) |
|
|
273
580
|
| `singleImage` | Tek Görsel | `data` | Alt yazılı, köşe yuvarlatmalı (`borderRadius`) ve dış linkli görsel |
|
|
274
581
|
| `gallery` | Galeri | `galleryList` | Resmi **Swiper.js** (`swiper`) veya çok sütunlu ızgara (`gridGallery`) + `sharp` thumbnail + tam boyutlu Lightbox Popup |
|
|
275
582
|
| `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;
|
|
583
|
+
| `tab` | Sekme (Tab) | `tabAccItems` | Yatay/Dikey sekmeler; Color Codes & renk seçici ile arka plan, yazı, aktif sekme ve aktif alt çizgi rengi (`indicatorColor`/`indicatorHeight`), zengin HTML ve iç içe (nested) `ContentInput` ızgarası |
|
|
584
|
+
| `accordion` | Akordiyon | `tabAccItems` | Tekli/Çoklu açılır paneller; Color Codes & renk seçici ile başlık, yazı, aktif panel ve alt vurgu çizgisi rengi, zengin HTML ve iç içe `ContentInput` ızgarası |
|
|
278
585
|
| `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` |
|
|
586
|
+
| `contentForm` | Dinamik Form | `formData`, `submitForm` | PostgreSQL tabanlı dinamik form (`CIDynamicForm`), dinamik Strapi `i18n` dil desteği, `vee-validate` kuralları, reCAPTCHA v2 ve Mailtrap/Mailgun/SMTP gönderimi |
|
|
587
|
+
| `survey` | Anket & Oylama | `surveyData`, `submitSurvey` | Çok adımlı sihirbaz / hızlı oylama (`CISurvey`), 13 soru tipi (NPS, Yıldız, Likert, Matris, Borda Sıralama, Görsel Seçim vb.), koşullu mantık, HMAC mükerrer oy engelleme ve canlı `%` sonuç grafikleri |
|
|
280
588
|
| `iframe` | Iframe | `data` | Harita veya harici sayfa yerleştirme (özelleştirilebilir yükseklik) |
|
|
281
589
|
| `banner` | Banner | `data` | Kampanya ve tanıtım alanı (`#widget-banner` veya `:components="{ banner: MyBanner }"` ile özelleştirmeye hazır) |
|
|
282
590
|
|
|
283
591
|
### `npx` Komutu ile Nuxt Şablonlarını Projeye Kopyalama (`eject`)
|
|
284
592
|
```bash
|
|
285
|
-
# Vuetify projeleri için:
|
|
593
|
+
# Vuetify projeleri için (CIHeroSlider.vue, CIDataTable.vue, CICustomCard.vue, CIDynamicForm.vue, CISurvey.vue ve utils/colorCodes.ts dahil tüm dosyaları kopyalar):
|
|
286
594
|
npx strapi-content-input-vuetify eject ./components/content-input
|
|
287
595
|
|
|
288
596
|
# Element Plus projeleri için:
|
|
@@ -291,7 +599,9 @@ npx strapi-content-input-ep eject ./components/content-input
|
|
|
291
599
|
|
|
292
600
|
---
|
|
293
601
|
|
|
294
|
-
##
|
|
602
|
+
## 7. Lokal Geliştirme, GitLab CI/CD ve Playground Ortamları
|
|
603
|
+
|
|
604
|
+
> **Not (`dist/` ve GitLab CI/CD):** Derlenmiş `dist/` klasörü Git deposuna **push edilmez** (`.gitignore` içerisindedir). Paket GitLab CI/CD boru hattında (`.gitlab-ci.yml`) otomatik derlenir ve `git+ssh` kurulumlarında `package.json` içindeki `"prepare": "npm run build"` betiği sayesinde tüketici projede otomatik olarak inşa edilir.
|
|
295
605
|
|
|
296
606
|
```bash
|
|
297
607
|
# 1. PostgreSQL veritabanını başlatın
|
|
@@ -303,5 +613,6 @@ npm --prefix playground run dev
|
|
|
303
613
|
```
|
|
304
614
|
|
|
305
615
|
- **Strapi Admin Paneli:** `http://localhost:1337/admin` (`ozguraltan05@gmail.com` / `12345678`)
|
|
616
|
+
- **Strapi Anket & Form Raporlama Merkezi:** `http://localhost:1337/admin/plugins/content-input`
|
|
306
617
|
- **Nuxt Vuetify Playground:** `http://localhost:3001`
|
|
307
618
|
- **Nuxt Element Plus Playground:** `http://localhost:3002`
|