diff --git a/assets/css/admin/form-builder.css b/assets/css/admin/form-builder.css index 39a22d708..ed0dea820 100644 --- a/assets/css/admin/form-builder.css +++ b/assets/css/admin/form-builder.css @@ -819,6 +819,64 @@ html { --tw-contain-style: ; } +.wpuf-form-input,.wpuf-form-textarea,.wpuf-form-select,.wpuf-form-multiselect { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #6b7280; + border-width: 1px; + border-radius: 0px; + padding-top: 0.5rem; + padding-right: 0.75rem; + padding-bottom: 0.5rem; + padding-left: 0.75rem; + font-size: 1rem; + line-height: 1.5rem; + --tw-shadow: 0 0 #0000; +} + +.wpuf-form-input:focus, .wpuf-form-textarea:focus, .wpuf-form-select:focus, .wpuf-form-multiselect:focus { + outline: 2px solid transparent; + outline-offset: 2px; + --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: #2563eb; + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + border-color: #2563eb; +} + +.wpuf-form-input::-moz-placeholder, .wpuf-form-textarea::-moz-placeholder { + color: #6b7280; + opacity: 1; +} + +.wpuf-form-input::placeholder,.wpuf-form-textarea::placeholder { + color: #6b7280; + opacity: 1; +} + +.wpuf-form-input::-webkit-datetime-edit-fields-wrapper { + padding: 0; +} + +.wpuf-form-input::-webkit-date-and-time-value { + min-height: 1.5em; + text-align: inherit; +} + +.wpuf-form-input::-webkit-datetime-edit { + display: inline-flex; +} + +.wpuf-form-input::-webkit-datetime-edit,.wpuf-form-input::-webkit-datetime-edit-year-field,.wpuf-form-input::-webkit-datetime-edit-month-field,.wpuf-form-input::-webkit-datetime-edit-day-field,.wpuf-form-input::-webkit-datetime-edit-hour-field,.wpuf-form-input::-webkit-datetime-edit-minute-field,.wpuf-form-input::-webkit-datetime-edit-second-field,.wpuf-form-input::-webkit-datetime-edit-millisecond-field,.wpuf-form-input::-webkit-datetime-edit-meridiem-field { + padding-top: 0; + padding-bottom: 0; +} + .wpuf-avatar { position: relative; display: inline-flex; @@ -932,6 +990,187 @@ html { content: var(--tw-content); } +.wpuf-chat-image { + grid-row: span 2 / span 2; + align-self: flex-end; +} + +.wpuf-chat-header { + grid-row-start: 1; + font-size: 0.875rem; + line-height: 1.25rem; +} + +.wpuf-chat-footer { + grid-row-start: 3; + font-size: 0.875rem; + line-height: 1.25rem; +} + +.wpuf-chat-bubble { + position: relative; + display: block; + width: -moz-fit-content; + width: fit-content; + padding-left: 1rem; + padding-right: 1rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + max-width: 90%; + border-radius: var(--rounded-box, 1rem); + min-height: 2.75rem; + min-width: 2.75rem; + --tw-bg-opacity: 1; + background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity))); + --tw-text-opacity: 1; + color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity))); +} + +.wpuf-chat-bubble:before { + position: absolute; + bottom: 0px; + height: 0.75rem; + width: 0.75rem; + background-color: inherit; + content: ""; + -webkit-mask-size: contain; + mask-size: contain; + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-position: center; + mask-position: center; +} + +.wpuf-chat-start { + place-items: start; + grid-template-columns: auto 1fr; +} + +.wpuf-chat-start .wpuf-chat-header { + grid-column-start: 2; +} + +.wpuf-chat-start .wpuf-chat-footer { + grid-column-start: 2; +} + +.wpuf-chat-start .wpuf-chat-image { + grid-column-start: 1; +} + +.wpuf-chat-start .wpuf-chat-bubble { + grid-column-start: 2; + border-end-start-radius: 0px; +} + +.wpuf-chat-start .wpuf-chat-bubble:before { + -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 3 3 L 3 0 C 3 1 1 3 0 3'/%3e%3c/svg%3e"); + mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 3 3 L 3 0 C 3 1 1 3 0 3'/%3e%3c/svg%3e"); + inset-inline-start: -0.749rem; +} + +[dir="rtl"] .wpuf-chat-start .wpuf-chat-bubble:before { + -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e"); + mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e"); +} + +.wpuf-chat-end { + place-items: end; + grid-template-columns: 1fr auto; +} + +.wpuf-chat-end .wpuf-chat-header { + grid-column-start: 1; +} + +.wpuf-chat-end .wpuf-chat-footer { + grid-column-start: 1; +} + +.wpuf-chat-end .wpuf-chat-image { + grid-column-start: 2; +} + +.wpuf-chat-end .wpuf-chat-bubble { + grid-column-start: 1; + border-end-end-radius: 0px; +} + +.wpuf-chat-end .wpuf-chat-bubble:before { + -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e"); + mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 1 3 L 3 3 C 2 3 0 1 0 0'/%3e%3c/svg%3e"); + inset-inline-start: 99.9%; +} + +[dir="rtl"] .wpuf-chat-end .wpuf-chat-bubble:before { + -webkit-mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 3 3 L 3 0 C 3 1 1 3 0 3'/%3e%3c/svg%3e"); + mask-image: url("data:image/svg+xml,%3csvg width='3' height='3' xmlns='http://www.w3.org/2000/svg'%3e%3cpath fill='black' d='m 0 3 L 3 3 L 3 0 C 3 1 1 3 0 3'/%3e%3c/svg%3e"); +} + +.wpuf-collapse:not(td):not(tr):not(colgroup) { + visibility: visible; +} + +.wpuf-collapse { + position: relative; + display: grid; + overflow: hidden; + grid-template-rows: auto 0fr; + transition: grid-template-rows 0.2s; + width: 100%; + border-radius: var(--rounded-box, 1rem); +} + +.wpuf-collapse-title, +.wpuf-collapse > input[type="checkbox"], +.wpuf-collapse > input[type="radio"], +.wpuf-collapse-content { + grid-column-start: 1; + grid-row-start: 1; +} + +.wpuf-collapse > input[type="checkbox"], +.wpuf-collapse > input[type="radio"] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + opacity: 0; +} + +.wpuf-collapse-content { + visibility: hidden; + grid-column-start: 1; + grid-row-start: 2; + min-height: 0px; + transition: visibility 0.2s; + transition: padding 0.2s ease-out, + background-color 0.2s ease-out; + padding-left: 1rem; + padding-right: 1rem; + cursor: unset; +} + +.wpuf-collapse[open], +.wpuf-collapse-open, +.wpuf-collapse:focus:not(.wpuf-collapse-close) { + grid-template-rows: auto 1fr; +} + +.wpuf-collapse:not(.wpuf-collapse-close):has(> input[type="checkbox"]:checked), +.wpuf-collapse:not(.wpuf-collapse-close):has(> input[type="radio"]:checked) { + grid-template-rows: auto 1fr; +} + +.wpuf-collapse[open] > .wpuf-collapse-content, +.wpuf-collapse-open > .wpuf-collapse-content, +.wpuf-collapse:focus:not(.wpuf-collapse-close) > .wpuf-collapse-content, +.wpuf-collapse:not(.wpuf-collapse-close) > input[type="checkbox"]:checked ~ .wpuf-collapse-content, +.wpuf-collapse:not(.wpuf-collapse-close) > input[type="radio"]:checked ~ .wpuf-collapse-content { + visibility: visible; + min-height: -moz-fit-content; + min-height: fit-content; +} + .wpuf-dropdown { position: relative; display: inline-block; @@ -1656,6 +1895,134 @@ input.wpuf-tab:checked + .wpuf-tab-content, } } +details.wpuf-collapse { + width: 100%; +} + +details.wpuf-collapse summary { + position: relative; + display: block; + outline: 2px solid transparent; + outline-offset: 2px; +} + +details.wpuf-collapse summary::-webkit-details-marker { + display: none; +} + +.wpuf-collapse:focus-visible { + outline-style: solid; + outline-width: 2px; + outline-offset: 2px; + outline-color: var(--fallback-bc,oklch(var(--bc)/1)); +} + +.wpuf-collapse:has(.wpuf-collapse-title:focus-visible), +.wpuf-collapse:has(> input[type="checkbox"]:focus-visible), +.wpuf-collapse:has(> input[type="radio"]:focus-visible) { + outline-style: solid; + outline-width: 2px; + outline-offset: 2px; + outline-color: var(--fallback-bc,oklch(var(--bc)/1)); +} + +.wpuf-collapse-arrow > .wpuf-collapse-title:after { + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); + position: absolute; + display: block; + height: 0.5rem; + width: 0.5rem; + --tw-translate-y: -100%; + --tw-rotate: 45deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); + transition-duration: 150ms; + transition-duration: 0.2s; + top: 1.9rem; + inset-inline-end: 1.4rem; + content: ""; + transform-origin: 75% 75%; + box-shadow: 2px 2px; + pointer-events: none; +} + +.wpuf-collapse-plus > .wpuf-collapse-title:after { + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); + position: absolute; + display: block; + height: 0.5rem; + width: 0.5rem; + transition-property: all; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); + transition-duration: 300ms; + top: 0.9rem; + inset-inline-end: 1.4rem; + content: "+"; + pointer-events: none; +} + +.wpuf-collapse:not(.wpuf-collapse-open):not(.wpuf-collapse-close) > input[type="checkbox"], +.wpuf-collapse:not(.wpuf-collapse-open):not(.wpuf-collapse-close) > input[type="radio"]:not(:checked), +.wpuf-collapse:not(.wpuf-collapse-open):not(.wpuf-collapse-close) > .wpuf-collapse-title { + cursor: pointer; +} + +.wpuf-collapse:focus:not(.wpuf-collapse-open):not(.wpuf-collapse-close):not(.wpuf-collapse[open]) > .wpuf-collapse-title { + cursor: unset; +} + +.wpuf-collapse-title { + position: relative; +} + +:where(.wpuf-collapse > input[type="checkbox"]), +:where(.wpuf-collapse > input[type="radio"]) { + z-index: 1; +} + +.wpuf-collapse-title, +:where(.wpuf-collapse > input[type="checkbox"]), +:where(.wpuf-collapse > input[type="radio"]) { + width: 100%; + padding: 1rem; + padding-inline-end: 3rem; + min-height: 3.75rem; + transition: background-color 0.2s ease-out; +} + +.wpuf-collapse[open] > :where(.wpuf-collapse-content), +.wpuf-collapse-open > :where(.wpuf-collapse-content), +.wpuf-collapse:focus:not(.wpuf-collapse-close) > :where(.wpuf-collapse-content), +.wpuf-collapse:not(.wpuf-collapse-close) > :where(input[type="checkbox"]:checked ~ .wpuf-collapse-content), +.wpuf-collapse:not(.wpuf-collapse-close) > :where(input[type="radio"]:checked ~ .wpuf-collapse-content) { + padding-bottom: 1rem; + transition: padding 0.2s ease-out, + background-color 0.2s ease-out; +} + +.wpuf-collapse[open].wpuf-collapse-arrow > .wpuf-collapse-title:after, +.wpuf-collapse-open.wpuf-collapse-arrow > .wpuf-collapse-title:after, +.wpuf-collapse-arrow:focus:not(.wpuf-collapse-close) > .wpuf-collapse-title:after, +.wpuf-collapse-arrow:not(.wpuf-collapse-close) > input[type="checkbox"]:checked ~ .wpuf-collapse-title:after, +.wpuf-collapse-arrow:not(.wpuf-collapse-close) > input[type="radio"]:checked ~ .wpuf-collapse-title:after { + --tw-translate-y: -50%; + --tw-rotate: 225deg; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.wpuf-collapse[open].wpuf-collapse-plus > .wpuf-collapse-title:after, +.wpuf-collapse-open.wpuf-collapse-plus > .wpuf-collapse-title:after, +.wpuf-collapse-plus:focus:not(.wpuf-collapse-close) > .wpuf-collapse-title:after, +.wpuf-collapse-plus:not(.wpuf-collapse-close) > input[type="checkbox"]:checked ~ .wpuf-collapse-title:after, +.wpuf-collapse-plus:not(.wpuf-collapse-close) > input[type="radio"]:checked ~ .wpuf-collapse-title:after { + content: "−"; +} + .wpuf-dropdown.wpuf-dropdown-open .wpuf-dropdown-content, .wpuf-dropdown:focus .wpuf-dropdown-content, .wpuf-dropdown:focus-within .wpuf-dropdown-content { @@ -2468,6 +2835,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, pointer-events: none; } +.wpuf-collapse { + visibility: collapse; +} + .\!wpuf-static { position: static !important; } @@ -2513,6 +2884,14 @@ input.wpuf-tab:checked + .wpuf-tab-content, left: 0px; } +.wpuf-left-1 { + left: 0.25rem; +} + +.wpuf-left-1\/2 { + left: 50%; +} + .wpuf-left-\[-2\%\] { left: -2%; } @@ -2585,6 +2964,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, top: -40%; } +.wpuf-top-\[275px\] { + top: 275px; +} + .wpuf-top-\[50\%\] { top: 50%; } @@ -2593,6 +2976,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, top: 7%; } +.wpuf-top-\[93px\] { + top: 93px; +} + .wpuf-z-10 { z-index: 10; } @@ -2712,6 +3099,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, margin-right: 1rem; } +.wpuf-mx-5 { + margin-left: 1.25rem; + margin-right: 1.25rem; +} + .wpuf-mx-auto { margin-left: auto; margin-right: auto; @@ -2825,6 +3217,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, margin-bottom: 3.5rem; } +.wpuf-mb-16 { + margin-bottom: 4rem; +} + .wpuf-mb-2 { margin-bottom: 0.5rem; } @@ -2849,6 +3245,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, margin-bottom: 1.5rem; } +.wpuf-mb-7 { + margin-bottom: 1.75rem; +} + .wpuf-mb-8 { margin-bottom: 2rem; } @@ -3064,6 +3464,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, height: 2.5rem; } +.wpuf-h-11 { + height: 2.75rem; +} + .wpuf-h-12 { height: 3rem; } @@ -3072,6 +3476,9 @@ input.wpuf-tab:checked + .wpuf-tab-content, height: 4rem; } +.wpuf-h-2 { + height: 0.5rem; +} .wpuf-h-24 { height: 6rem; } @@ -3100,6 +3507,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, height: 20rem; } +.wpuf-h-9 { + height: 2.25rem; +} + .wpuf-h-\[180\%\] { height: 180%; } @@ -3108,6 +3519,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, height: 50vh; } +.wpuf-h-\[60vh\] { + height: 60vh; +} + .wpuf-h-\[70vh\] { height: 70vh; } @@ -3116,6 +3531,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, height: 80vh; } +.wpuf-h-auto { + height: auto; +} + .wpuf-h-full { height: 100%; } @@ -3138,12 +3557,40 @@ input.wpuf-tab:checked + .wpuf-tab-content, height: 100svh; } +.wpuf-max-h-\[1072px\] { + max-height: 1072px; +} + +.wpuf-max-h-\[120px\] { + max-height: 120px; +} + +.wpuf-max-h-\[calc\(100vh-300px\)\] { + max-height: calc(100vh - 300px); +} + .wpuf-max-h-screen { max-height: 100vh; } -.wpuf-min-h-16 { - min-height: 4rem; +.wpuf-min-h-16 { + min-height: 4rem; +} + +.wpuf-min-h-\[100px\] { + min-height: 100px; +} + +.wpuf-min-h-\[416px\] { + min-height: 416px; +} + +.wpuf-min-h-\[44px\] { + min-height: 44px; +} + +.wpuf-min-h-\[672px\] { + min-height: 672px; } .wpuf-min-h-full { @@ -3200,6 +3647,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, width: 3rem; } +.wpuf-w-16 { + width: 4rem; +} + .wpuf-w-2 { width: 0.5rem; } @@ -3276,6 +3727,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, width: 20rem; } +.wpuf-w-9 { + width: 2.25rem; +} + .wpuf-w-\[104\%\] { width: 104%; } @@ -3318,6 +3773,14 @@ input.wpuf-tab:checked + .wpuf-tab-content, min-width: 0px; } +.wpuf-min-w-\[101px\] { + min-width: 101px; +} + +.wpuf-min-w-\[158px\] { + min-width: 158px; +} + .wpuf-min-w-full { min-width: 100%; } @@ -3338,6 +3801,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, max-width: 1400px; } +.wpuf-max-w-\[720px\] { + max-width: 720px; +} + .wpuf-max-w-\[768px\] { max-width: 768px; } @@ -3350,6 +3817,14 @@ input.wpuf-tab:checked + .wpuf-tab-content, max-width: 32rem; } +.wpuf-max-w-md { + max-width: 28rem; +} + +.wpuf-max-w-xl { + max-width: 36rem; +} + .wpuf-max-w-xs { max-width: 20rem; } @@ -3406,6 +3881,16 @@ input.wpuf-tab:checked + .wpuf-tab-content, transform-origin: top right; } +.wpuf--translate-x-1 { + --tw-translate-x: -0.25rem; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.wpuf--translate-x-1\/2 { + --tw-translate-x: -50%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + .wpuf--translate-x-\[50\%\] { --tw-translate-x: -50%; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -3467,6 +3952,26 @@ input.wpuf-tab:checked + .wpuf-tab-content, transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); } +@keyframes wpuf-pulse { + 50% { + opacity: .5; + } +} + +.wpuf-animate-pulse { + animation: wpuf-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; +} + +@keyframes wpuf-spin { + to { + transform: rotate(360deg); + } +} + +.wpuf-animate-spin { + animation: wpuf-spin 1s linear infinite; +} + .wpuf-cursor-not-allowed { cursor: not-allowed; } @@ -3479,6 +3984,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, cursor: wait; } +.wpuf-resize-none { + resize: none; +} + .wpuf-list-none { list-style-type: none; } @@ -3515,6 +4024,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, align-items: flex-start; } +.wpuf-items-end { + align-items: flex-end; +} + .wpuf-items-center { align-items: center; } @@ -3547,6 +4060,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, justify-content: space-evenly; } +.wpuf-justify-items-center { + justify-items: center; +} + .wpuf-gap-1 { gap: 0.25rem; } @@ -3571,10 +4088,18 @@ input.wpuf-tab:checked + .wpuf-tab-content, gap: 1rem; } +.wpuf-gap-5 { + gap: 1.25rem; +} + .wpuf-gap-6 { gap: 1.5rem; } +.wpuf-gap-8 { + gap: 2rem; +} + .wpuf-gap-x-1 { -moz-column-gap: 0.25rem; column-gap: 0.25rem; @@ -3691,6 +4216,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-radius: 6px !important; } +.\!wpuf-rounded-md { + border-radius: 0.375rem !important; +} + .wpuf-rounded { border-radius: 0.25rem; } @@ -3776,6 +4305,14 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-top-right-radius: 0.75rem; } +.wpuf-rounded-bl { + border-bottom-left-radius: 0.25rem; +} + +.wpuf-rounded-br { + border-bottom-right-radius: 0.25rem; +} + .wpuf-rounded-tr-lg { border-top-right-radius: 0.5rem; } @@ -3873,6 +4410,15 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-style: none !important; } +.wpuf-border-none { + border-style: none; +} + +.\!wpuf-border-emerald-600 { + --tw-border-opacity: 1 !important; + border-color: rgb(5 150 105 / var(--tw-border-opacity)) !important; +} + .\!wpuf-border-gray-300 { --tw-border-opacity: 1 !important; border-color: rgb(209 213 219 / var(--tw-border-opacity)) !important; @@ -3897,6 +4443,16 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-color: transparent !important; } +.wpuf-border-blue-200 { + --tw-border-opacity: 1; + border-color: rgb(191 219 254 / var(--tw-border-opacity)); +} + +.wpuf-border-blue-300 { + --tw-border-opacity: 1; + border-color: rgb(147 197 253 / var(--tw-border-opacity)); +} + .wpuf-border-blue-500 { --tw-border-opacity: 1; border-color: rgb(59 130 246 / var(--tw-border-opacity)); @@ -3907,6 +4463,16 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-color: rgb(167 243 208 / var(--tw-border-opacity)); } +.wpuf-border-emerald-500 { + --tw-border-opacity: 1; + border-color: rgb(16 185 129 / var(--tw-border-opacity)); +} + +.wpuf-border-emerald-600 { + --tw-border-opacity: 1; + border-color: rgb(5 150 105 / var(--tw-border-opacity)); +} + .wpuf-border-gray-100 { --tw-border-opacity: 1; border-color: rgb(243 244 246 / var(--tw-border-opacity)); @@ -3952,15 +4518,40 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-color: rgb(5 150 105 / var(--tw-border-opacity)); } +.wpuf-border-purple-300 { + --tw-border-opacity: 1; + border-color: rgb(216 180 254 / var(--tw-border-opacity)); +} + +.wpuf-border-red-200 { + --tw-border-opacity: 1; + border-color: rgb(254 202 202 / var(--tw-border-opacity)); +} + .wpuf-border-red-500 { --tw-border-opacity: 1; border-color: rgb(239 68 68 / var(--tw-border-opacity)); } +.wpuf-border-slate-200 { + --tw-border-opacity: 1; + border-color: rgb(226 232 240 / var(--tw-border-opacity)); +} + +.wpuf-border-slate-300 { + --tw-border-opacity: 1; + border-color: rgb(203 213 225 / var(--tw-border-opacity)); +} + .wpuf-border-transparent { border-color: transparent; } +.wpuf-border-white { + --tw-border-opacity: 1; + border-color: rgb(255 255 255 / var(--tw-border-opacity)); +} + .wpuf-border-yellow-200 { --tw-border-opacity: 1; border-color: rgb(254 240 138 / var(--tw-border-opacity)); @@ -3981,6 +4572,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, border-color: rgb(212 212 216 / var(--tw-border-opacity)); } +.wpuf-border-t-transparent { + border-top-color: transparent; +} + .\!wpuf-bg-green-600 { --tw-bg-opacity: 1 !important; background-color: rgb(22 163 74 / var(--tw-bg-opacity)) !important; @@ -3996,6 +4591,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important; } +.wpuf-bg-\[\#ECFDF5\] { + --tw-bg-opacity: 1; + background-color: rgb(236 253 245 / var(--tw-bg-opacity)); +} + .wpuf-bg-amber-500 { --tw-bg-opacity: 1; background-color: rgb(245 158 11 / var(--tw-bg-opacity)); @@ -4010,11 +4610,30 @@ input.wpuf-tab:checked + .wpuf-tab-content, background-color: rgb(0 0 0 / 0.25); } +.wpuf-bg-blue-100 { + --tw-bg-opacity: 1; + background-color: rgb(219 234 254 / var(--tw-bg-opacity)); +} + +.wpuf-bg-blue-50 { + --tw-bg-opacity: 1; + background-color: rgb(239 246 255 / var(--tw-bg-opacity)); +} + .wpuf-bg-blue-500 { --tw-bg-opacity: 1; background-color: rgb(59 130 246 / var(--tw-bg-opacity)); } +.wpuf-bg-emerald-300 { + --tw-bg-opacity: 1; + background-color: rgb(110 231 183 / var(--tw-bg-opacity)); +} + +.wpuf-bg-emerald-400 { + --tw-bg-opacity: 1; + background-color: rgb(52 211 153 / var(--tw-bg-opacity)); +} .wpuf-bg-emerald-100 { --tw-bg-opacity: 1; background-color: rgb(209 250 229 / var(--tw-bg-opacity)); @@ -4025,11 +4644,21 @@ input.wpuf-tab:checked + .wpuf-tab-content, background-color: rgb(236 253 245 / var(--tw-bg-opacity)); } +.wpuf-bg-emerald-500 { + --tw-bg-opacity: 1; + background-color: rgb(16 185 129 / var(--tw-bg-opacity)); +} + .wpuf-bg-emerald-600 { --tw-bg-opacity: 1; background-color: rgb(5 150 105 / var(--tw-bg-opacity)); } +.wpuf-bg-emerald-700 { + --tw-bg-opacity: 1; + background-color: rgb(4 120 87 / var(--tw-bg-opacity)); +} + .wpuf-bg-emerald-900 { --tw-bg-opacity: 1; background-color: rgb(6 78 59 / var(--tw-bg-opacity)); @@ -4104,6 +4733,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, background-color: rgb(16 185 129 / var(--tw-bg-opacity)); } +.wpuf-bg-purple-50 { + --tw-bg-opacity: 1; + background-color: rgb(250 245 255 / var(--tw-bg-opacity)); +} + .wpuf-bg-red-100 { --tw-bg-opacity: 1; background-color: rgb(254 226 226 / var(--tw-bg-opacity)); @@ -4153,10 +4787,18 @@ input.wpuf-tab:checked + .wpuf-tab-content, background-color: rgb(254 252 232 / var(--tw-bg-opacity)); } +.wpuf-bg-opacity-50 { + --tw-bg-opacity: 0.5; +} + .wpuf-bg-opacity-75 { --tw-bg-opacity: 0.75; } +.wpuf-bg-opacity-80 { + --tw-bg-opacity: 0.8; +} + .\!wpuf-stroke-primary { stroke: #059669 !important; } @@ -4173,6 +4815,16 @@ input.wpuf-tab:checked + .wpuf-tab-content, stroke: #6b7280; } +.wpuf-object-contain { + -o-object-fit: contain; + object-fit: contain; +} + +.wpuf-object-cover { + -o-object-fit: cover; + object-fit: cover; +} + .\!wpuf-p-0 { padding: 0px !important; } @@ -4225,6 +4877,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, padding: 2rem; } +.wpuf-p-9 { + padding: 2.25rem; +} + .wpuf-p-\[10px\] { padding: 10px; } @@ -4417,6 +5073,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, padding-bottom: 0px; } +.wpuf-pb-3 { + padding-bottom: 0.75rem; +} + .wpuf-pb-4 { padding-bottom: 1rem; } @@ -4433,6 +5093,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, padding-bottom: 2rem; } +.wpuf-pb-9 { + padding-bottom: 2.25rem; +} + .wpuf-pl-0 { padding-left: 0px; } @@ -4513,6 +5177,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, padding-top: 1.5rem; } +.wpuf-pt-9 { + padding-top: 2.25rem; +} + .wpuf-pt-\[40px\] { padding-top: 40px; } @@ -4537,6 +5205,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, vertical-align: middle; } +.wpuf-font-mono { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + .wpuf-font-sans { font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; } @@ -4673,10 +5345,18 @@ input.wpuf-tab:checked + .wpuf-tab-content, line-height: 2rem; } +.wpuf-leading-9 { + line-height: 2.25rem; +} + .wpuf-leading-none { line-height: 1; } +.wpuf-tracking-normal { + letter-spacing: 0em; +} + .wpuf-tracking-tight { letter-spacing: -0.025em; } @@ -4686,6 +5366,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, color: rgb(0 0 0 / var(--tw-text-opacity)) !important; } +.\!wpuf-text-emerald-200 { + --tw-text-opacity: 1 !important; + color: rgb(167 243 208 / var(--tw-text-opacity)) !important; +} + .\!wpuf-text-gray-700 { --tw-text-opacity: 1 !important; color: rgb(55 65 81 / var(--tw-text-opacity)) !important; @@ -4706,6 +5391,26 @@ input.wpuf-tab:checked + .wpuf-tab-content, color: rgb(0 0 0 / var(--tw-text-opacity)); } +.wpuf-text-blue-600 { + --tw-text-opacity: 1; + color: rgb(37 99 235 / var(--tw-text-opacity)); +} + +.wpuf-text-blue-800 { + --tw-text-opacity: 1; + color: rgb(30 64 175 / var(--tw-text-opacity)); +} + +.wpuf-text-emerald-200 { + --tw-text-opacity: 1; + color: rgb(167 243 208 / var(--tw-text-opacity)); +} + +.wpuf-text-emerald-600 { + --tw-text-opacity: 1; + color: rgb(5 150 105 / var(--tw-text-opacity)); +} + .wpuf-text-emerald-700 { --tw-text-opacity: 1; color: rgb(4 120 87 / var(--tw-text-opacity)); @@ -4716,6 +5421,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, color: rgb(6 95 70 / var(--tw-text-opacity)); } +.wpuf-text-gray-300 { + --tw-text-opacity: 1; + color: rgb(209 213 219 / var(--tw-text-opacity)); +} + .wpuf-text-gray-400 { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); @@ -4781,6 +5491,16 @@ input.wpuf-tab:checked + .wpuf-tab-content, color: rgb(5 150 105 / var(--tw-text-opacity)); } +.wpuf-text-purple-500 { + --tw-text-opacity: 1; + color: rgb(168 85 247 / var(--tw-text-opacity)); +} + +.wpuf-text-purple-600 { + --tw-text-opacity: 1; + color: rgb(147 51 234 / var(--tw-text-opacity)); +} + .wpuf-text-purple-800 { --tw-text-opacity: 1; color: rgb(107 33 168 / var(--tw-text-opacity)); @@ -4831,6 +5551,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, color: rgb(234 179 8 / var(--tw-text-opacity)); } +.wpuf-text-yellow-600 { + --tw-text-opacity: 1; + color: rgb(202 138 4 / var(--tw-text-opacity)); +} + .wpuf-text-yellow-700 { --tw-text-opacity: 1; color: rgb(161 98 7 / var(--tw-text-opacity)); @@ -4853,10 +5578,22 @@ input.wpuf-tab:checked + .wpuf-tab-content, opacity: 1; } +.wpuf-opacity-25 { + opacity: 0.25; +} + +.wpuf-opacity-40 { + opacity: 0.4; +} + .wpuf-opacity-50 { opacity: 0.5; } +.wpuf-opacity-75 { + opacity: 0.75; +} + .\!wpuf-shadow-none { --tw-shadow: 0 0 #0000 !important; --tw-shadow-colored: 0 0 #0000 !important; @@ -4910,6 +5647,11 @@ input.wpuf-tab:checked + .wpuf-tab-content, --tw-shadow: var(--tw-shadow-colored); } +.wpuf-outline-none { + outline: 2px solid transparent; + outline-offset: 2px; +} + .wpuf-outline { outline-style: solid; } @@ -4940,6 +5682,12 @@ input.wpuf-tab:checked + .wpuf-tab-content, box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); } +.wpuf-ring-2 { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + .wpuf-ring-inset { --tw-ring-inset: inset; } @@ -4958,6 +5706,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, --tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity)); } +.wpuf-ring-emerald-200 { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(167 243 208 / var(--tw-ring-opacity)); +} .wpuf-ring-gray-200 { --tw-ring-opacity: 1; --tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity)); @@ -5059,6 +5811,10 @@ input.wpuf-tab:checked + .wpuf-tab-content, transition-duration: 200ms; } +.wpuf-duration-500 { + transition-duration: 500ms; +} + .wpuf-duration-300 { transition-duration: 300ms; } @@ -5707,11 +6463,21 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { border-color: rgb(29 78 216 / var(--tw-border-opacity)); } +.hover\:wpuf-border-emerald-600:hover { + --tw-border-opacity: 1; + border-color: rgb(5 150 105 / var(--tw-border-opacity)); +} + .hover\:wpuf-border-gray-300:hover { --tw-border-opacity: 1; border-color: rgb(209 213 219 / var(--tw-border-opacity)); } +.hover\:wpuf-border-gray-400:hover { + --tw-border-opacity: 1; + border-color: rgb(156 163 175 / var(--tw-border-opacity)); +} + .hover\:wpuf-border-primary:hover { --tw-border-opacity: 1; border-color: rgb(5 150 105 / var(--tw-border-opacity)); @@ -5727,6 +6493,11 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { border-color: rgb(14 165 233 / var(--tw-border-opacity)); } +.hover\:\!wpuf-bg-gray-50:hover { + --tw-bg-opacity: 1 !important; + background-color: rgb(249 250 251 / var(--tw-bg-opacity)) !important; +} + .hover\:\!wpuf-bg-green-50:hover { --tw-bg-opacity: 1 !important; background-color: rgb(240 253 244 / var(--tw-bg-opacity)) !important; @@ -5742,6 +6513,16 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { background-color: rgb(29 78 216 / var(--tw-bg-opacity)); } +.hover\:wpuf-bg-emerald-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(4 120 87 / var(--tw-bg-opacity)); +} + +.hover\:wpuf-bg-emerald-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(6 95 70 / var(--tw-bg-opacity)); +} + .hover\:wpuf-bg-emerald-100:hover { --tw-bg-opacity: 1; background-color: rgb(209 250 229 / var(--tw-bg-opacity)); @@ -5792,6 +6573,11 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { background-color: rgb(185 28 28 / var(--tw-bg-opacity)); } +.hover\:wpuf-bg-red-800:hover { + --tw-bg-opacity: 1; + background-color: rgb(153 27 27 / var(--tw-bg-opacity)); +} + .hover\:wpuf-bg-slate-100:hover { --tw-bg-opacity: 1; background-color: rgb(241 245 249 / var(--tw-bg-opacity)); @@ -5825,6 +6611,16 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { color: rgb(55 65 81 / var(--tw-text-opacity)) !important; } +.hover\:wpuf-text-emerald-200:hover { + --tw-text-opacity: 1; + color: rgb(167 243 208 / var(--tw-text-opacity)); +} + +.hover\:wpuf-text-emerald-700:hover { + --tw-text-opacity: 1; + color: rgb(4 120 87 / var(--tw-text-opacity)); +} + .hover\:wpuf-text-gray-500:hover { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); @@ -5943,6 +6739,11 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { border-color: transparent !important; } +.focus\:wpuf-border-emerald-500:focus { + --tw-border-opacity: 1; + border-color: rgb(16 185 129 / var(--tw-border-opacity)); +} + .focus\:wpuf-border-primary:focus { --tw-border-opacity: 1; border-color: rgb(5 150 105 / var(--tw-border-opacity)); @@ -5979,12 +6780,23 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important; } +.focus\:wpuf-shadow-lg:focus { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + .focus\:wpuf-shadow-none:focus { --tw-shadow: 0 0 #0000; --tw-shadow-colored: 0 0 #0000; box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.focus\:wpuf-shadow-emerald-100:focus { + --tw-shadow-color: #d1fae5; + --tw-shadow: var(--tw-shadow-colored); +} + .focus\:wpuf-shadow-primary:focus { --tw-shadow-color: #059669; --tw-shadow: var(--tw-shadow-colored); @@ -6027,6 +6839,11 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { --tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity)); } +.focus\:wpuf-ring-emerald-200:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(167 243 208 / var(--tw-ring-opacity)); +} + .focus\:wpuf-ring-gray-300:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity)); @@ -6131,6 +6948,15 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); } +.disabled\:wpuf-cursor-not-allowed:disabled { + cursor: not-allowed; +} + +.disabled\:wpuf-bg-gray-400:disabled { + --tw-bg-opacity: 1; + background-color: rgb(156 163 175 / var(--tw-bg-opacity)); +} + .disabled\:wpuf-opacity-50:disabled { opacity: 0.5; } @@ -6240,10 +7066,19 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { margin-right: -1.5rem; } + .sm\:wpuf-mx-auto { + margin-left: auto; + margin-right: auto; + } + .sm\:wpuf-flex { display: flex; } + .sm\:wpuf-h-\[70vh\] { + height: 70vh; + } + .sm\:wpuf-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } @@ -6272,6 +7107,18 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { padding: 0px; } + .sm\:wpuf-p-5 { + padding: 1.25rem; + } + + .sm\:wpuf-p-6 { + padding: 1.5rem; + } + + .sm\:wpuf-p-9 { + padding: 2.25rem; + } + .sm\:wpuf-px-6 { padding-left: 1.5rem; padding-right: 1.5rem; @@ -6306,6 +7153,10 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { display: inline-block; } + .md\:wpuf-h-\[75vh\] { + height: 75vh; + } + .md\:wpuf-w-3\/4 { width: 75%; } @@ -6325,6 +7176,20 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { margin-right: -2rem; } + .lg\:wpuf-h-\[80vh\] { + height: 80vh; + } + + .lg\:wpuf-flex-row { + flex-direction: row; + } + + .lg\:wpuf-p-8 { + padding: 2rem; + } + + .lg\:wpuf-p-9 { + padding: 2.25rem; .lg\:wpuf-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } @@ -6336,6 +7201,10 @@ button.swal2-cancel.swal2-styled.swal2-default-outline { } @media (min-width: 1280px) { + .xl\:wpuf-h-\[85vh\] { + height: 85vh; + } + .xl\:wpuf-mt-10 { margin-top: 2.5rem; } diff --git a/assets/js/wpuf-admin.js b/assets/js/wpuf-admin.js index 4a52e7e83..1da88f31a 100644 --- a/assets/js/wpuf-admin.js +++ b/assets/js/wpuf-admin.js @@ -217,4 +217,74 @@ jQuery(function($) { $('.wpuf-fields input[type="radio"][name="_downloadable"][value="no"]').prop('checked', true); } }); + + // AI Provider change event listener to filter AI Models + $('#wpuf_ai\\[ai_provider\\]').on('change', function() { + var selectedProvider = $(this).val(); + var aiModelSelect = $('#wpuf_ai\\[ai_model\\]'); + var $this = $(this); + + // If no provider selected, show all models + if (!selectedProvider) { + // Restore all options if stored + if (aiModelSelect.data('all-options')) { + aiModelSelect.empty().append(aiModelSelect.data('all-options')); + } + return; + } + + // Store all options for restoration if needed + if (!aiModelSelect.data('all-options')) { + aiModelSelect.data('all-options', aiModelSelect.find('option').clone()); + } + + // Get provider configuration via AJAX + $.ajax({ + url: wpuf_admin_script.ajaxurl, + type: 'POST', + data: { + action: 'wpuf_get_ai_provider_configs', + nonce: wpuf_admin_script.nonce + }, + success: function(response) { + if (response.success && response.data) { + var providerConfigs = response.data; + var selectedProviderConfig = providerConfigs[selectedProvider]; + + if (selectedProviderConfig && selectedProviderConfig.models) { + // Clear current options + aiModelSelect.empty(); + + // Add default option + aiModelSelect.append(''); + + // Add models for the selected provider + $.each(selectedProviderConfig.models, function(modelKey, modelName) { + aiModelSelect.append(''); + }); + + // Try to preserve current selection if it's valid for the selected provider + var currentDbValue = aiModelSelect.attr('data-current-value') || aiModelSelect.val(); + if (currentDbValue && selectedProviderConfig.models[currentDbValue]) { + aiModelSelect.val(currentDbValue); + } else { + // Set first available model as default + var firstModelKey = Object.keys(selectedProviderConfig.models)[0]; + if (firstModelKey) { + aiModelSelect.val(firstModelKey); + } + } + } + } else { + console.error('Failed to load AI provider configurations'); + } + }, + error: function() { + console.error('AJAX error loading AI provider configurations'); + } + }); + }); + + // Trigger change event on page load to filter models based on pre-selected provider + $('#wpuf_ai\\[ai_provider\\]').trigger('change'); }); diff --git a/includes/Admin/Posting.php b/includes/Admin/Posting.php index 0681a90ec..582888e62 100644 --- a/includes/Admin/Posting.php +++ b/includes/Admin/Posting.php @@ -461,10 +461,6 @@ public function render_form( $form_id, $post_id = null ) { if ( typeof wpuf_map_items === 'undefined' ) { wpuf_map_items = []; } - - // Test if field initialization script is loaded - console.log('Admin metabox script loaded'); - console.log('WPUF_Field_Initializer available:', typeof WPUF_Field_Initializer !== 'undefined'); register_ajax( 'wpuf_ajax_address', 'wpuf_ajax_get_states_field' ); $this->register_ajax( 'wpuf_update_billing_address', 'wpuf_update_billing_address' ); $this->register_ajax( 'wpuf_clear_schedule_lock', 'wpuf_clear_schedule_lock', $this->logged_in_only ); + $this->register_ajax( 'wpuf_get_ai_provider_configs', 'wpuf_get_ai_provider_configs_ajax', $this->logged_in_only ); } /** diff --git a/includes/class-frontend-render-form.php b/includes/class-frontend-render-form.php index 9d75b9b37..3c2cd8279 100644 --- a/includes/class-frontend-render-form.php +++ b/includes/class-frontend-render-form.php @@ -930,7 +930,7 @@ public function render_featured_field( $post_id = null ) {
diff --git a/includes/functions/settings-options.php b/includes/functions/settings-options.php index d0c0725c0..64180f537 100644 --- a/includes/functions/settings-options.php +++ b/includes/functions/settings-options.php @@ -49,6 +49,11 @@ function wpuf_settings_sections() { 'title' => __( 'Privacy Options', 'wp-user-frontend' ), 'icon' => 'dashicons-shield-alt', ], + [ + 'id' => 'wpuf_ai', + 'title' => __( 'AI Settings', 'wp-user-frontend' ), + 'icon' => 'dashicons-admin-network', + ], ]; return apply_filters( 'wpuf_settings_sections', $sections ); @@ -632,6 +637,33 @@ function wpuf_settings_fields() { 'options' => $post_types, ], ] ), + 'wpuf_ai' => apply_filters( 'wpuf_ai_options', [ + [ + 'name' => 'ai_provider', + 'label' => __( 'AI Provider', 'wp-user-frontend' ), + 'desc' => __( 'Select the AI service provider you want to use.', 'wp-user-frontend' ), + 'type' => 'select', + 'options' => wpuf_get_ai_provider_options(), + 'default' => 'openai', + 'class' => 'ai-provider-select', + ], + [ + 'name' => 'ai_model', + 'label' => __( 'AI Model', 'wp-user-frontend' ), + 'desc' => __( 'Select the AI model to use for content generation.', 'wp-user-frontend' ), + 'type' => 'select', + 'options' => wpuf_get_ai_model_options(), + 'default' => 'gpt-3.5-turbo', + 'class' => 'ai-model-select', + ], + [ + 'name' => 'ai_api_key', + 'label' => __( 'API Key', 'wp-user-frontend' ), + 'desc' => __( 'Enter your AI service API key. Keep this secure and never share it publicly.', 'wp-user-frontend' ), + 'type' => 'text', + 'default' => '', + ], + ] ), ]; return apply_filters( 'wpuf_settings_fields', $settings_fields ); diff --git a/languages/wp-user-frontend.pot b/languages/wp-user-frontend.pot index 017b75deb..15ec84b01 100644 --- a/languages/wp-user-frontend.pot +++ b/languages/wp-user-frontend.pot @@ -24,6 +24,118 @@ msgstr "" "X-Textdomain-Support: yes\n" "X-Generator: grunt-wp-i18n 1.0.3\n" +#: Lib/AI/PredefinedProvider.php:1024 Lib/AI/PredefinedProvider.php:1040 +#: includes/Admin/Forms/Admin_Form.php:254 +#: includes/Admin/Forms/Admin_Form.php:260 +#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:46 +#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Video.php:104 +#: includes/Fields/Field_Contract.php:238 +#: includes/Fields/Form_Field_Dropdown.php:110 +#: includes/Fields/Form_Field_MultiDropdown.php:85 +#: includes/Fields/Form_Field_Post_Taxonomy.php:500 +msgid "- Select -" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1071 +#: admin/form-builder/assets/js/components/form-featured_image/template.php:7 +#: admin/form-builder/assets/js/components/form-image_upload/template.php:11 +#: assets/js-templates/form-components.php:1020 +#: assets/js-templates/form-components.php:1237 class/render-form.php:1685 +#: includes/Fields/Form_Field_Featured_Image.php:128 +#: includes/Fields/Form_Field_Image.php:122 +#: includes/Fields/Form_Field_Image.php:143 includes/Render_Form.php:1576 +msgid "Select Image" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1119 +#: templates/dashboard/billing-address.php:132 +msgid "Address Line 1" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1127 +#: templates/dashboard/billing-address.php:140 +msgid "Address Line 2" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1135 includes/Admin/Customizer_Options.php:49 +#: includes/Admin/Customizer_Options.php:90 +#: includes/Ajax/Address_Form_Ajax.php:265 includes/WPUF_Privacy.php:266 +#: templates/dashboard/billing-address.php:147 +#: templates/dashboard/billing-address.php:148 +msgid "City" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1143 +msgid "Zip Code" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1151 includes/Admin/Customizer_Options.php:45 +#: includes/Admin/Customizer_Options.php:86 +#: includes/Ajax/Address_Form_Ajax.php:167 includes/Traits/TaxableTrait.php:81 +#: includes/Traits/TaxableTrait.php:216 includes/WPUF_Privacy.php:278 +#: templates/dashboard/billing-address.php:50 +#: templates/dashboard/billing-address.php:51 +msgid "Country" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1161 includes/WPUF_Privacy.php:270 +msgid "State" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1202 admin/html/form-settings-post.php:7 +#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:145 +#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Video.php:167 +msgid "This page is restricted. Please {login} / {register} to view this page." +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1205 +msgid "Create %s" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1219 +msgid "" +"%s has been updated successfully. View " +"%s" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1221 +msgid "Update %s" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1226 +msgid "New %s has been created" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1227 +msgid "" +"Hi,\n" +"A new %s has been created in your site {sitename} ({siteurl}).\n" +"\n" +"Here is the details:\n" +"Title: {post_title}\n" +"Description: {post_content}\n" +"Author: {author}\n" +"URL: {permalink}\n" +"Edit URL: {editlink}" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1238 +msgid "%s has been edited" +msgstr "" + +#: Lib/AI/PredefinedProvider.php:1239 +msgid "" +"Hi,\n" +"The %s \"{post_title}\" has been updated\n" +"\n" +"Here is the details:\n" +"Title: {post_title}\n" +"Description: {post_content}\n" +"Author: {author}\n" +"URL: {permalink}\n" +"Edit URL: {editlink}" +msgstr "" + #: Lib/Gateway/Bank.php:32 msgid "Bank Instruction" msgstr "" @@ -32,7 +144,7 @@ msgstr "" msgid "Bank Payment Success Page" msgstr "" -#: Lib/Gateway/Bank.php:40 includes/functions/settings-options.php:559 +#: Lib/Gateway/Bank.php:40 includes/functions/settings-options.php:564 msgid "After payment users will be redirected here" msgstr "" @@ -217,40 +329,40 @@ msgstr "" msgid "WP User Frontend" msgstr "" -#: admin/class-admin-settings.php:89 includes/Admin/Menu.php:24 +#: admin/class-admin-settings.php:90 includes/Admin/Menu.php:24 msgid "User Frontend" msgstr "" -#: admin/class-admin-settings.php:91 includes/Admin/Menu.php:28 +#: admin/class-admin-settings.php:92 includes/Admin/Menu.php:28 #: includes/Admin/Menu.php:29 msgid "Post Forms" msgstr "" -#: admin/class-admin-settings.php:104 includes/Admin/Menu.php:49 +#: admin/class-admin-settings.php:105 includes/Admin/Menu.php:49 #: includes/Admin/Menu.php:50 msgid "Subscriptions" msgstr "" -#: admin/class-admin-settings.php:110 includes/Admin/Admin_Tools.php:370 +#: admin/class-admin-settings.php:111 includes/Admin/Admin_Tools.php:370 #: includes/Admin/Menu.php:59 #: includes/Admin/views/transactions-list-table-view.php:2 msgid "Transactions" msgstr "" -#: admin/class-admin-settings.php:113 includes/Admin/Menu.php:64 +#: admin/class-admin-settings.php:114 includes/Admin/Menu.php:64 #: includes/Admin/views/tools.php:7 msgid "Tools" msgstr "" -#: admin/class-admin-settings.php:118 includes/Admin/Menu.php:76 +#: admin/class-admin-settings.php:119 includes/Admin/Menu.php:76 msgid "Premium" msgstr "" -#: admin/class-admin-settings.php:120 includes/Admin/Menu.php:81 +#: admin/class-admin-settings.php:121 includes/Admin/Menu.php:81 msgid "Help" msgstr "" -#: admin/class-admin-settings.php:121 admin/class-admin-settings.php:169 +#: admin/class-admin-settings.php:122 admin/class-admin-settings.php:170 #: admin/form-builder/views/form-builder-v4.1.php:141 #: admin/form-builder/views/form-builder.php:9 #: includes/Admin/Admin_Settings.php:68 includes/Admin/Menu.php:92 @@ -260,20 +372,20 @@ msgstr "" msgid "Settings" msgstr "" -#: admin/class-admin-settings.php:123 includes/Admin/Admin_Subscription.php:300 +#: admin/class-admin-settings.php:124 includes/Admin/Admin_Subscription.php:300 #: includes/Admin/Menu.php:86 includes/Admin/views/subscribers.php:14 msgid "Subscribers" msgstr "" -#: admin/class-admin-settings.php:466 includes/Admin/Menu.php:214 +#: admin/class-admin-settings.php:467 includes/Admin/Menu.php:214 msgid "Number of items per page:" msgstr "" -#: admin/class-admin-settings.php:497 includes/Admin.php:90 +#: admin/class-admin-settings.php:498 includes/Admin.php:101 msgid "Post lock has been cleared" msgstr "" -#: admin/class-admin-settings.php:501 includes/Admin.php:102 +#: admin/class-admin-settings.php:502 includes/Admin.php:113 #. translators: %1$s opening div tag, %2$s shortcode, %3$s opening strong tag, #. %4$s closing strong tag, %5$s closing div tag. #. translators: %1$s is the opening div tag, %2$s is the shortcode @@ -286,37 +398,37 @@ msgid "" "vulnerability.%4$s" msgstr "" -#: admin/class-admin-settings.php:537 includes/Admin/Menu.php:330 +#: admin/class-admin-settings.php:538 includes/Admin/Menu.php:330 msgid "WPUF Import Forms" msgstr "" -#: admin/class-admin-settings.php:538 includes/Admin/Menu.php:331 +#: admin/class-admin-settings.php:539 includes/Admin/Menu.php:331 msgid "Add JSON file" msgstr "" -#: admin/class-admin-settings.php:539 includes/Admin/Menu.php:332 +#: admin/class-admin-settings.php:540 includes/Admin/Menu.php:332 msgid "Could not import forms." msgstr "" -#: admin/class-admin-settings.php:619 +#: admin/class-admin-settings.php:620 #: includes/Admin/Forms/Admin_Form_Handler.php:60 #: includes/Admin/Forms/Admin_Form_Handler.php:202 msgid "You do not have sufficient permissions to do this action" msgstr "" -#: admin/class-admin-settings.php:624 includes/Admin/Admin_Tools.php:475 +#: admin/class-admin-settings.php:625 includes/Admin/Admin_Tools.php:475 msgid "Missing file_id param" msgstr "" -#: admin/class-admin-settings.php:634 includes/Admin/Admin_Tools.php:486 +#: admin/class-admin-settings.php:635 includes/Admin/Admin_Tools.php:486 msgid "JSON file not found" msgstr "" -#: admin/class-admin-settings.php:643 includes/Admin/Admin_Tools.php:496 +#: admin/class-admin-settings.php:644 includes/Admin/Admin_Tools.php:496 msgid "Provided file is not a JSON file." msgstr "" -#: admin/class-admin-settings.php:660 includes/Admin/Admin_Tools.php:508 +#: admin/class-admin-settings.php:661 includes/Admin/Admin_Tools.php:508 msgid "Forms imported successfully." msgstr "" @@ -500,7 +612,7 @@ msgstr "" #: admin/form-builder/views/post-form-settings.php:220 #: includes/Admin/Forms/Admin_Form_Builder.php:344 #: includes/Admin/template-parts/modal-v4.1.php:124 -#: includes/Admin/template-parts/modal-v4.2.php:273 +#: includes/Admin/template-parts/modal-v4.2.php:362 #: includes/Admin/template-parts/modal.php:109 #: includes/Free/Free_Loader.php:1062 includes/Free/Free_Loader.php:1144 #: includes/Free/templates/page-registration-form.php:193 @@ -605,7 +717,7 @@ msgid "Payment Options" msgstr "" #: admin/html/form-settings-payment.php:26 includes/Setup_Wizard.php:339 -#: includes/functions/settings-options.php:472 wpuf-functions.php:5368 +#: includes/functions/settings-options.php:477 wpuf-functions.php:5368 msgid "Enable Payments" msgstr "" @@ -670,7 +782,7 @@ msgid "Amount to be charged per post" msgstr "" #: admin/html/form-settings-payment.php:88 -#: includes/functions/settings-options.php:558 wpuf-functions.php:5403 +#: includes/functions/settings-options.php:563 wpuf-functions.php:5403 msgid "Payment Success Page" msgstr "" @@ -762,12 +874,6 @@ msgstr "" msgid "After how many hours user will be locked from editing the submitted post." msgstr "" -#: admin/html/form-settings-post.php:7 -#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:145 -#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Video.php:167 -msgid "This page is restricted. Please {login} / {register} to view this page." -msgstr "" - #: admin/html/form-settings-post.php:15 wpuf-functions.php:5163 msgid "Post saved" msgstr "" @@ -949,7 +1055,7 @@ msgid "Choose which roles can submit posts." msgstr "" #: admin/html/form-submission-restriction.php:117 -#: includes/functions/settings-options.php:333 wpuf-functions.php:5351 +#: includes/functions/settings-options.php:338 wpuf-functions.php:5351 msgid "Unauthorized Message" msgstr "" @@ -1194,7 +1300,7 @@ msgid "No custom fields found." msgstr "" #: admin/posting.php:547 includes/Admin/Admin_Tools.php:465 -#: includes/Admin/Posting.php:869 includes/Admin/Promotion.php:216 +#: includes/Admin/Posting.php:864 includes/Admin/Promotion.php:216 #: includes/Admin/Promotion.php:220 includes/Admin/Promotion.php:224 #: includes/Admin/Promotion.php:301 includes/Admin/Promotion.php:305 #: includes/Admin/Promotion.php:309 @@ -1863,6 +1969,114 @@ msgstr "" msgid "You must purchase a pack before posting" msgstr "" +#: includes/AI/RestController.php:215 +msgid "Rate limit exceeded. Please try again later." +msgstr "" + +#: includes/AI/RestController.php:237 +msgid "Form generation failed" +msgstr "" + +#: includes/AI/RestController.php:252 +msgid "An error occurred while generating the form. Please try again." +msgstr "" + +#: includes/AI/RestController.php:321 +msgid "Settings saved successfully" +msgstr "" + +#: includes/AI/RestController.php:326 +msgid "Failed to save settings" +msgstr "" + +#: includes/AI/RestController.php:391 +msgid "Prompt cannot be empty" +msgstr "" + +#: includes/AI/RestController.php:398 +msgid "Prompt is too long. Maximum 1000 characters allowed." +msgstr "" + +#: includes/AI/RestController.php:446 +msgid "Form title and fields are required" +msgstr "" + +#: includes/AI/RestController.php:514 +msgid "Submit Form" +msgstr "" + +#: includes/AI/RestController.php:517 +msgid "Form has been updated successfully." +msgstr "" + +#: includes/AI/RestController.php:518 +msgid "Update Form" +msgstr "" + +#: includes/AI/RestController.php:536 +msgid "Form created successfully" +msgstr "" + +#: includes/AI/RestController.php:544 +msgid "An error occurred while creating the form. Please try again." +msgstr "" + +#: includes/AI/RestController.php:566 +msgid "Form not found" +msgstr "" + +#: includes/AI/RestController.php:579 +msgid "Modification prompt is required" +msgstr "" + +#: includes/AI/RestController.php:598 +msgid "Failed to process modification request" +msgstr "" + +#: includes/AI/RestController.php:637 +msgid "Invalid modification type from AI" +msgstr "" + +#: includes/AI/RestController.php:662 +msgid "Form modified successfully" +msgstr "" + +#: includes/AI/RestController.php:701 +msgid "Form updated successfully" +msgstr "" + +#: includes/AI/RestController.php:706 +msgid "AI response format not recognized" +msgstr "" + +#: includes/AI/RestController.php:724 +msgid "Form modification failed" +msgstr "" + +#: includes/AI_Manager.php:82 +msgid "Generating form..." +msgstr "" + +#: includes/AI_Manager.php:83 +msgid "Error occurred while generating form" +msgstr "" + +#: includes/AI_Manager.php:84 +msgid "Form generated successfully" +msgstr "" + +#: includes/AI_Manager.php:119 +msgid "Test Connection" +msgstr "" + +#: includes/AI_Manager.php:120 +msgid "Connection successful" +msgstr "" + +#: includes/AI_Manager.php:121 +msgid "Connection failed" +msgstr "" + #: includes/Admin/Admin_Subscription.php:79 #. translators: %s: post type label msgid "Number of %s" @@ -2094,7 +2308,7 @@ msgid "Select Package:" msgstr "" #: includes/Admin/Admin_Subscription.php:950 -#: includes/functions/settings-options.php:675 wpuf-functions.php:1978 +#: includes/functions/settings-options.php:707 wpuf-functions.php:1978 #: wpuf-functions.php:2244 msgid "— Select —" msgstr "" @@ -2545,19 +2759,10 @@ msgstr "" #: includes/Admin/Customizer_Options.php:44 #: includes/Admin/Customizer_Options.php:85 -#: includes/functions/settings-options.php:372 +#: includes/functions/settings-options.php:377 msgid "Show Billing Address" msgstr "" -#: includes/Admin/Customizer_Options.php:45 -#: includes/Admin/Customizer_Options.php:86 -#: includes/Ajax/Address_Form_Ajax.php:167 includes/Traits/TaxableTrait.php:81 -#: includes/Traits/TaxableTrait.php:216 includes/WPUF_Privacy.php:278 -#: templates/dashboard/billing-address.php:50 -#: templates/dashboard/billing-address.php:51 -msgid "Country" -msgstr "" - #: includes/Admin/Customizer_Options.php:46 #: includes/Admin/Customizer_Options.php:87 #: includes/Ajax/Address_Form_Ajax.php:210 @@ -2576,14 +2781,6 @@ msgstr "" msgid "Address line 2" msgstr "" -#: includes/Admin/Customizer_Options.php:49 -#: includes/Admin/Customizer_Options.php:90 -#: includes/Ajax/Address_Form_Ajax.php:265 includes/WPUF_Privacy.php:266 -#: templates/dashboard/billing-address.php:147 -#: templates/dashboard/billing-address.php:148 -msgid "City" -msgstr "" - #: includes/Admin/Customizer_Options.php:50 #: includes/Admin/Customizer_Options.php:91 #: includes/Ajax/Address_Form_Ajax.php:275 @@ -2617,6 +2814,29 @@ msgstr "" msgid "WP User Frontend News & Updates" msgstr "" +#: includes/Admin/Forms/AI_Form_Handler.php:30 +#: includes/Admin/Forms/AI_Form_Handler.php:72 +msgid "Security check failed" +msgstr "" + +#: includes/Admin/Forms/AI_Form_Handler.php:35 +#: includes/Admin/Forms/AI_Form_Handler.php:77 +#: includes/Admin/Forms/AI_Form_Handler.php:112 +msgid "You do not have sufficient permissions to access this page." +msgstr "" + +#: includes/Admin/Forms/AI_Form_Handler.php:51 +msgid "Create Form with AI" +msgstr "" + +#: includes/Admin/Forms/AI_Form_Handler.php:91 +msgid "Generating Form" +msgstr "" + +#: includes/Admin/Forms/AI_Form_Handler.php:126 +msgid "Form Created Successfully" +msgstr "" + #: includes/Admin/Forms/Admin_Form.php:54 #: includes/Admin/Forms/Admin_Form.php:74 #: includes/Admin/Forms/Admin_Form.php:76 @@ -2685,17 +2905,6 @@ msgstr "" msgid "Registration Forms" msgstr "" -#: includes/Admin/Forms/Admin_Form.php:254 -#: includes/Admin/Forms/Admin_Form.php:260 -#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:46 -#: includes/Admin/Forms/Post/Templates/Post_Form_Template_Video.php:104 -#: includes/Fields/Field_Contract.php:238 -#: includes/Fields/Form_Field_Dropdown.php:110 -#: includes/Fields/Form_Field_MultiDropdown.php:85 -#: includes/Fields/Form_Field_Post_Taxonomy.php:500 -msgid "- Select -" -msgstr "" - #: includes/Admin/Forms/Admin_Form.php:298 msgid "Post Fields" msgstr "" @@ -2849,7 +3058,7 @@ msgid "" msgstr "" #: includes/Admin/Forms/Post/Templates/Post_Form_Template_Post.php:16 -#: includes/Admin/Menu.php:116 includes/Admin/template-parts/modal-v4.2.php:45 +#: includes/Admin/Menu.php:116 includes/Admin/template-parts/modal-v4.2.php:61 #: includes/Admin/views/shortcode-builder.php:8 #: includes/Free/Free_Loader.php:1711 includes/Free/Free_Loader.php:1715 #: includes/Free/Free_Loader.php:1719 includes/Free/Free_Loader.php:1723 @@ -3209,52 +3418,84 @@ msgid "" "Are you sure you wish to run the updater now?" msgstr "" +#: includes/Admin/template-parts/ai-form-builder.php:60 +#: includes/Admin/views/post-forms-list-table-view.php:4 +#: includes/Admin/views/subscriptions.php:4 +msgid "" +"We're sorry but this page doesn't work properly without JavaScript. Please " +"enable it to continue." +msgstr "" + +#: includes/Admin/template-parts/ai-form-builder.php:63 +#: includes/Admin/views/post-forms-list-table-view.php:8 +#: includes/Admin/views/subscriptions.php:8 +msgid "Loading" +msgstr "" + #: includes/Admin/template-parts/modal-v4.1.php:25 msgid "Select from a pre-defined template or from a blank form" msgstr "" #: includes/Admin/template-parts/modal-v4.1.php:37 #: includes/Admin/template-parts/modal-v4.1.php:94 -#: includes/Admin/template-parts/modal-v4.2.php:175 -#: includes/Admin/template-parts/modal-v4.2.php:236 +#: includes/Admin/template-parts/modal-v4.2.php:198 +#: includes/Admin/template-parts/modal-v4.2.php:325 #: includes/Admin/template-parts/modal.php:39 #: includes/Admin/template-parts/modal.php:75 msgid "Create Form" msgstr "" #: includes/Admin/template-parts/modal-v4.1.php:83 -#: includes/Admin/template-parts/modal-v4.2.php:225 +#: includes/Admin/template-parts/modal-v4.2.php:314 #: includes/Admin/template-parts/modal.php:60 msgid "This integration is not installed." msgstr "" -#: includes/Admin/template-parts/modal-v4.2.php:21 -#: includes/Admin/template-parts/modal-v4.2.php:41 +#: includes/Admin/template-parts/modal-v4.2.php:37 +#: includes/Admin/template-parts/modal-v4.2.php:57 msgid "E-commerce" msgstr "" -#: includes/Admin/template-parts/modal-v4.2.php:25 +#: includes/Admin/template-parts/modal-v4.2.php:41 msgid "Membership" msgstr "" -#: includes/Admin/template-parts/modal-v4.2.php:102 +#: includes/Admin/template-parts/modal-v4.2.php:118 msgid "Select a %s Template" msgstr "" -#: includes/Admin/template-parts/modal-v4.2.php:106 +#: includes/Admin/template-parts/modal-v4.2.php:122 msgid "" "Select from a pre-defined template to get started quickly, or start from a " "blank form to build your own from scratch" msgstr "" -#: includes/Admin/template-parts/modal-v4.2.php:119 +#: includes/Admin/template-parts/modal-v4.2.php:135 msgid "Search Templates" msgstr "" -#: includes/Admin/template-parts/modal-v4.2.php:135 +#: includes/Admin/template-parts/modal-v4.2.php:151 msgid "All Templates" msgstr "" +#: includes/Admin/template-parts/modal-v4.2.php:263 +msgid "Create with AI" +msgstr "" + +#: includes/Admin/template-parts/modal-v4.2.php:391 +msgid "AI Provider Not Configured" +msgstr "" + +#: includes/Admin/template-parts/modal-v4.2.php:396 +msgid "" +"To use AI Form Generation, please connect an AI provider by adding your API " +"key in the settings" +msgstr "" + +#: includes/Admin/template-parts/modal-v4.2.php:405 +msgid "Go to Settings" +msgstr "" + #: includes/Admin/template-parts/modal.php:5 msgid "Modal window. Press escape to close." msgstr "" @@ -3293,18 +3534,6 @@ msgid "" "for Posting to Exclusive Content Access." msgstr "" -#: includes/Admin/views/post-forms-list-table-view.php:4 -#: includes/Admin/views/subscriptions.php:4 -msgid "" -"We're sorry but this page doesn't work properly without JavaScript. Please " -"enable it to continue." -msgstr "" - -#: includes/Admin/views/post-forms-list-table-view.php:8 -#: includes/Admin/views/subscriptions.php:8 -msgid "Loading" -msgstr "" - #: includes/Admin/views/post-forms-list-table-view.php:16 #. translators: %s is url msgid "Learn more about Frontend Posting" @@ -3973,7 +4202,7 @@ msgid "Learn More About Registration" msgstr "" #: includes/Admin/views/support.php:531 -#: includes/functions/settings-options.php:428 +#: includes/functions/settings-options.php:433 msgid "Login Page" msgstr "" @@ -5932,20 +6161,6 @@ msgstr "" msgid "%1$sError%2$s: Cloudflare Turnstile verification failed. Reasons: [%3$s]" msgstr "" -#: includes/Free/Simple_Login.php:530 includes/Free/Simple_Login.php:571 -#: includes/Frontend/Registration.php:184 -#: includes/Frontend/Registration.php:191 -#: includes/Frontend/Registration.php:198 -#: includes/Frontend/Registration.php:205 -#: includes/Frontend/Registration.php:212 -#: includes/Frontend/Registration.php:219 -#: includes/Frontend/Registration.php:226 -#: includes/Frontend/Registration.php:233 -#: includes/Frontend/Registration.php:240 -#: includes/Frontend/Registration.php:253 -msgid "Error" -msgstr "" - #: includes/Free/Simple_Login.php:530 msgid "Cloudflare Turnstile verification failed. Reasons: [" msgstr "" @@ -6213,22 +6428,22 @@ msgid "Invalid form ID." msgstr "" #: includes/Frontend/Frontend_Account.php:43 -#: includes/functions/settings-options.php:379 +#: includes/functions/settings-options.php:384 msgid "Post Submission" msgstr "" #: includes/Frontend/Frontend_Account.php:44 -#: includes/functions/settings-options.php:380 +#: includes/functions/settings-options.php:385 msgid "Enable if you want to allow users to submit post from the account page." msgstr "" #: includes/Frontend/Frontend_Account.php:51 -#: includes/functions/settings-options.php:387 +#: includes/functions/settings-options.php:392 msgid "Submission Menu Label" msgstr "" #: includes/Frontend/Frontend_Account.php:52 -#: includes/functions/settings-options.php:388 +#: includes/functions/settings-options.php:393 msgid "Label for post submission menu" msgstr "" @@ -6236,17 +6451,17 @@ msgstr "" #: includes/Frontend/Frontend_Account.php:78 #: includes/Integrations/WPUF_WCMp_Integration.php:128 #: includes/Integrations/WPUF_WCMp_Integration.php:146 -#: includes/functions/settings-options.php:390 +#: includes/functions/settings-options.php:395 msgid "Submit Post" msgstr "" #: includes/Frontend/Frontend_Account.php:58 -#: includes/functions/settings-options.php:394 +#: includes/functions/settings-options.php:399 msgid "Submission Form" msgstr "" #: includes/Frontend/Frontend_Account.php:59 -#: includes/functions/settings-options.php:395 +#: includes/functions/settings-options.php:400 msgid "" "Select a post form that will use to submit post by the users from their " "account page." @@ -7352,10 +7567,6 @@ msgstr "" msgid "Billing Address 2" msgstr "" -#: includes/WPUF_Privacy.php:270 -msgid "State" -msgstr "" - #: includes/WPUF_Privacy.php:274 msgid "Zip" msgstr "" @@ -7533,516 +7744,544 @@ msgstr "" msgid "Privacy Options" msgstr "" -#: includes/functions/settings-options.php:64 +#: includes/functions/settings-options.php:54 +msgid "AI Settings" +msgstr "" + +#: includes/functions/settings-options.php:69 msgid "Previous Page" msgstr "" -#: includes/functions/settings-options.php:88 +#: includes/functions/settings-options.php:93 msgid "Show Admin Bar" msgstr "" -#: includes/functions/settings-options.php:89 +#: includes/functions/settings-options.php:94 msgid "Select user by roles, who can view admin bar in frontend." msgstr "" -#: includes/functions/settings-options.php:101 +#: includes/functions/settings-options.php:106 msgid "Admin area access" msgstr "" -#: includes/functions/settings-options.php:102 +#: includes/functions/settings-options.php:107 msgid "Allow you to block specific user role to Ajax request and Media upload." msgstr "" -#: includes/functions/settings-options.php:107 +#: includes/functions/settings-options.php:112 msgid "Admin Only" msgstr "" -#: includes/functions/settings-options.php:108 +#: includes/functions/settings-options.php:113 msgid "Admins, Editors" msgstr "" -#: includes/functions/settings-options.php:109 +#: includes/functions/settings-options.php:114 msgid "Admins, Editors, Authors" msgstr "" -#: includes/functions/settings-options.php:110 +#: includes/functions/settings-options.php:115 msgid "Admins, Editors, Authors, Contributors" msgstr "" -#: includes/functions/settings-options.php:111 +#: includes/functions/settings-options.php:116 msgid "Default" msgstr "" -#: includes/functions/settings-options.php:116 +#: includes/functions/settings-options.php:121 msgid "Override the post edit link" msgstr "" -#: includes/functions/settings-options.php:117 +#: includes/functions/settings-options.php:122 msgid "" "Users see the edit link in post if s/he is capable to edit the post/page. " "Selecting Yes will override the default WordPress edit " "post link in frontend" msgstr "" -#: includes/functions/settings-options.php:128 +#: includes/functions/settings-options.php:133 msgid "ACF Compatibility" msgstr "" -#: includes/functions/settings-options.php:131 +#: includes/functions/settings-options.php:136 #. translators: %1$s and %2$s are strong tags msgid "" "Select %1$sYes%2$s if you want to make compatible WPUF custom fields data " "with advanced custom fields." msgstr "" -#: includes/functions/settings-options.php:147 +#: includes/functions/settings-options.php:152 msgid "Load Scripts" msgstr "" -#: includes/functions/settings-options.php:148 +#: includes/functions/settings-options.php:153 msgid "Load scripts/styles in all pages" msgstr "" -#: includes/functions/settings-options.php:154 +#: includes/functions/settings-options.php:159 msgid "reCAPTCHA Site Key" msgstr "" -#: includes/functions/settings-options.php:158 +#: includes/functions/settings-options.php:163 msgid "reCAPTCHA Secret Key" msgstr "" -#: includes/functions/settings-options.php:159 +#: includes/functions/settings-options.php:164 msgid "" "Register " "here to get reCaptcha Site and Secret keys." msgstr "" -#: includes/functions/settings-options.php:164 +#: includes/functions/settings-options.php:169 msgid "Enable Turnstile" msgstr "" -#: includes/functions/settings-options.php:170 +#: includes/functions/settings-options.php:175 msgid "Turnstile Site Key" msgstr "" -#: includes/functions/settings-options.php:175 +#: includes/functions/settings-options.php:180 msgid "Turnstile Secret Key" msgstr "" -#: includes/functions/settings-options.php:179 +#: includes/functions/settings-options.php:184 #. translators: %s is a link msgid "" "Register here to get Turnstile Site " "and Secret keys." msgstr "" -#: includes/functions/settings-options.php:187 +#: includes/functions/settings-options.php:192 msgid "Custom CSS codes" msgstr "" -#: includes/functions/settings-options.php:188 +#: includes/functions/settings-options.php:193 msgid "" "If you want to add your custom CSS code, it will be added on page header " "wrapped with style tag" msgstr "" -#: includes/functions/settings-options.php:196 +#: includes/functions/settings-options.php:201 msgid "Edit Page" msgstr "" -#: includes/functions/settings-options.php:197 +#: includes/functions/settings-options.php:202 msgid "Select the page where [wpuf_edit] is located" msgstr "" -#: includes/functions/settings-options.php:203 +#: includes/functions/settings-options.php:208 msgid "Default Post Owner" msgstr "" -#: includes/functions/settings-options.php:204 +#: includes/functions/settings-options.php:209 msgid "" "If guest post is enabled and user details are OFF, the posts are assigned " "to this user" msgstr "" -#: includes/functions/settings-options.php:212 +#: includes/functions/settings-options.php:217 msgid "Custom Fields in post" msgstr "" -#: includes/functions/settings-options.php:213 +#: includes/functions/settings-options.php:218 msgid "Show custom fields on post content area" msgstr "" -#: includes/functions/settings-options.php:219 +#: includes/functions/settings-options.php:224 msgid "Insert Photo image size" msgstr "" -#: includes/functions/settings-options.php:220 +#: includes/functions/settings-options.php:225 msgid "" "Default image size of \"Insert Photo\" button in post " "content area" msgstr "" -#: includes/functions/settings-options.php:228 +#: includes/functions/settings-options.php:233 msgid "Insert Photo image type" msgstr "" -#: includes/functions/settings-options.php:229 +#: includes/functions/settings-options.php:234 msgid "" "Default image type of \"Insert Photo\" button in post " "content area" msgstr "" -#: includes/functions/settings-options.php:233 +#: includes/functions/settings-options.php:238 msgid "Image only" msgstr "" -#: includes/functions/settings-options.php:234 +#: includes/functions/settings-options.php:239 msgid "Image with link" msgstr "" -#: includes/functions/settings-options.php:240 +#: includes/functions/settings-options.php:245 msgid "Enable Image Caption" msgstr "" -#: includes/functions/settings-options.php:241 +#: includes/functions/settings-options.php:246 msgid "Allow users to update image/video title, caption and description" msgstr "" -#: includes/functions/settings-options.php:248 +#: includes/functions/settings-options.php:253 msgid "Default Post Form" msgstr "" -#: includes/functions/settings-options.php:249 +#: includes/functions/settings-options.php:254 msgid "Fallback form for post editing if no associated form found" msgstr "" -#: includes/functions/settings-options.php:257 +#: includes/functions/settings-options.php:262 msgid "Users can edit post?" msgstr "" -#: includes/functions/settings-options.php:258 +#: includes/functions/settings-options.php:263 msgid "Users will be able to edit their own posts" msgstr "" -#: includes/functions/settings-options.php:268 +#: includes/functions/settings-options.php:273 msgid "User can delete post?" msgstr "" -#: includes/functions/settings-options.php:269 +#: includes/functions/settings-options.php:274 msgid "Users will be able to delete their own posts" msgstr "" -#: includes/functions/settings-options.php:279 +#: includes/functions/settings-options.php:284 msgid "Pending Post Edit" msgstr "" -#: includes/functions/settings-options.php:280 +#: includes/functions/settings-options.php:285 msgid "Disable post editing while post in \"pending\" status" msgstr "" -#: includes/functions/settings-options.php:286 +#: includes/functions/settings-options.php:291 msgid "Editing Published Post" msgstr "" -#: includes/functions/settings-options.php:287 +#: includes/functions/settings-options.php:292 msgid "Disable post editing while post in \"publish\" status" msgstr "" -#: includes/functions/settings-options.php:293 +#: includes/functions/settings-options.php:298 msgid "Posts per page" msgstr "" -#: includes/functions/settings-options.php:294 +#: includes/functions/settings-options.php:299 msgid "How many posts will be listed in a page" msgstr "" -#: includes/functions/settings-options.php:300 +#: includes/functions/settings-options.php:305 msgid "Show user bio" msgstr "" -#: includes/functions/settings-options.php:301 +#: includes/functions/settings-options.php:306 msgid "Users biographical info will be shown" msgstr "" -#: includes/functions/settings-options.php:307 +#: includes/functions/settings-options.php:312 msgid "Show post count" msgstr "" -#: includes/functions/settings-options.php:308 +#: includes/functions/settings-options.php:313 msgid "Show how many posts are created by the user" msgstr "" -#: includes/functions/settings-options.php:314 +#: includes/functions/settings-options.php:319 msgid "Show Featured Image" msgstr "" -#: includes/functions/settings-options.php:315 +#: includes/functions/settings-options.php:320 msgid "Show featured image of the post (Overridden by Shortcode)" msgstr "" -#: includes/functions/settings-options.php:320 +#: includes/functions/settings-options.php:325 msgid "Show Payment Column" msgstr "" -#: includes/functions/settings-options.php:321 +#: includes/functions/settings-options.php:326 msgid "Enable if you want show payment column on posts table" msgstr "" -#: includes/functions/settings-options.php:327 +#: includes/functions/settings-options.php:332 msgid "Featured Image size" msgstr "" -#: includes/functions/settings-options.php:334 +#: includes/functions/settings-options.php:339 msgid "Not logged in users will see this message" msgstr "" -#: includes/functions/settings-options.php:341 +#: includes/functions/settings-options.php:346 msgid "Account Page" msgstr "" -#: includes/functions/settings-options.php:342 +#: includes/functions/settings-options.php:347 msgid "Select the page which contains [wpuf_account] shortcode" msgstr "" -#: includes/functions/settings-options.php:349 +#: includes/functions/settings-options.php:354 msgid "Select Custom Post For Account Page" msgstr "" -#: includes/functions/settings-options.php:350 +#: includes/functions/settings-options.php:355 msgid "Select the post types you want to show on user dashboard." msgstr "" -#: includes/functions/settings-options.php:356 +#: includes/functions/settings-options.php:361 msgid "Active Tab" msgstr "" -#: includes/functions/settings-options.php:357 +#: includes/functions/settings-options.php:362 msgid "Which tab should be set as active by default when opening the account page" msgstr "" -#: includes/functions/settings-options.php:364 +#: includes/functions/settings-options.php:369 msgid "Show Subscriptions" msgstr "" -#: includes/functions/settings-options.php:365 +#: includes/functions/settings-options.php:370 msgid "" "Show Subscriptions tab in \"my account\" page where " "[wpuf_account] is located" msgstr "" -#: includes/functions/settings-options.php:373 +#: includes/functions/settings-options.php:378 msgid "Show billing address in account page." msgstr "" -#: includes/functions/settings-options.php:404 +#: includes/functions/settings-options.php:409 msgid "Auto Login After Registration" msgstr "" -#: includes/functions/settings-options.php:405 +#: includes/functions/settings-options.php:410 msgid "If enabled, users after registration will be logged in to the system" msgstr "" -#: includes/functions/settings-options.php:412 +#: includes/functions/settings-options.php:417 msgid "Login/Registration override" msgstr "" -#: includes/functions/settings-options.php:413 +#: includes/functions/settings-options.php:418 msgid "" "If enabled, default login and registration forms will be overridden by WPUF " "with pages below" msgstr "" -#: includes/functions/settings-options.php:420 +#: includes/functions/settings-options.php:425 msgid "Registration Page" msgstr "" -#: includes/functions/settings-options.php:421 +#: includes/functions/settings-options.php:426 msgid "" "Select the page you want to use as registration page override (should " "have shortcode)" msgstr "" -#: includes/functions/settings-options.php:429 +#: includes/functions/settings-options.php:434 msgid "Select the page which contains [wpuf-login] shortcode" msgstr "" -#: includes/functions/settings-options.php:436 +#: includes/functions/settings-options.php:441 msgid "Redirect After Login" msgstr "" -#: includes/functions/settings-options.php:437 +#: includes/functions/settings-options.php:442 msgid "After successfull login, where the page will redirect to" msgstr "" -#: includes/functions/settings-options.php:443 +#: includes/functions/settings-options.php:448 msgid "Default Login Redirect" msgstr "" -#: includes/functions/settings-options.php:444 +#: includes/functions/settings-options.php:449 msgid "" "If enabled, users who login using WordPress default login form will be " "redirected to the selected page." msgstr "" -#: includes/functions/settings-options.php:451 +#: includes/functions/settings-options.php:456 msgid "reCAPTCHA in Login Form" msgstr "" -#: includes/functions/settings-options.php:452 +#: includes/functions/settings-options.php:457 msgid "" "If enabled, users have to verify reCAPTCHA in login page. Also, make sure " "that reCAPTCHA is configured properly from General Options" msgstr "" -#: includes/functions/settings-options.php:459 +#: includes/functions/settings-options.php:464 msgid "Turnstile in Login Form" msgstr "" -#: includes/functions/settings-options.php:460 +#: includes/functions/settings-options.php:465 msgid "" "If enabled, users have to verify Cloudflare Turnstile in login page. Also, " "make sure that Turnstile is configured properly from General Options" msgstr "" -#: includes/functions/settings-options.php:473 +#: includes/functions/settings-options.php:478 msgid "Enable payments on your site." msgstr "" -#: includes/functions/settings-options.php:479 +#: includes/functions/settings-options.php:484 msgid "Subscription Pack Page" msgstr "" -#: includes/functions/settings-options.php:480 +#: includes/functions/settings-options.php:485 msgid "Select the page where [wpuf_sub_pack] located." msgstr "" -#: includes/functions/settings-options.php:486 +#: includes/functions/settings-options.php:491 msgid "Subscription at registration" msgstr "" -#: includes/functions/settings-options.php:487 +#: includes/functions/settings-options.php:492 msgid "Registration time redirect to subscription page" msgstr "" -#: includes/functions/settings-options.php:492 +#: includes/functions/settings-options.php:497 msgid "Currency" msgstr "" -#: includes/functions/settings-options.php:499 +#: includes/functions/settings-options.php:504 msgid "Currency Position" msgstr "" -#: includes/functions/settings-options.php:503 +#: includes/functions/settings-options.php:508 msgid "Left" msgstr "" -#: includes/functions/settings-options.php:505 +#: includes/functions/settings-options.php:510 msgid "Right" msgstr "" -#: includes/functions/settings-options.php:507 +#: includes/functions/settings-options.php:512 msgid "Left with space" msgstr "" -#: includes/functions/settings-options.php:509 +#: includes/functions/settings-options.php:514 msgid "Right with space" msgstr "" -#: includes/functions/settings-options.php:515 +#: includes/functions/settings-options.php:520 msgid "Thousand Separator" msgstr "" -#: includes/functions/settings-options.php:516 +#: includes/functions/settings-options.php:521 msgid "This sets the thousand separator of displayed prices." msgstr "" -#: includes/functions/settings-options.php:524 +#: includes/functions/settings-options.php:529 msgid "Decimal Separator" msgstr "" -#: includes/functions/settings-options.php:525 +#: includes/functions/settings-options.php:530 msgid "This sets the decimal separator of displayed prices." msgstr "" -#: includes/functions/settings-options.php:531 +#: includes/functions/settings-options.php:536 msgid "Number of Decimals" msgstr "" -#: includes/functions/settings-options.php:532 +#: includes/functions/settings-options.php:537 msgid "This sets the number of decimal points shown in displayed prices." msgstr "" -#: includes/functions/settings-options.php:543 +#: includes/functions/settings-options.php:548 msgid "Enable demo/sandbox mode" msgstr "" -#: includes/functions/settings-options.php:544 +#: includes/functions/settings-options.php:549 msgid "When sandbox mode is active, all payment gateway will be used in demo mode" msgstr "" -#: includes/functions/settings-options.php:551 +#: includes/functions/settings-options.php:556 msgid "Payment Page" msgstr "" -#: includes/functions/settings-options.php:552 +#: includes/functions/settings-options.php:557 msgid "This page will be used to process payment options" msgstr "" -#: includes/functions/settings-options.php:565 +#: includes/functions/settings-options.php:570 msgid "Payment Gateways" msgstr "" -#: includes/functions/settings-options.php:566 +#: includes/functions/settings-options.php:571 msgid "Active payment gateways" msgstr "" -#: includes/functions/settings-options.php:572 +#: includes/functions/settings-options.php:577 msgid "Retry Failed Payment" msgstr "" -#: includes/functions/settings-options.php:573 +#: includes/functions/settings-options.php:578 msgid "How many times should retry for failed payment max is 4" msgstr "" -#: includes/functions/settings-options.php:587 +#: includes/functions/settings-options.php:592 msgid " Guest Email" msgstr "" -#: includes/functions/settings-options.php:595 +#: includes/functions/settings-options.php:600 msgid "Guest Email Notification" msgstr "" -#: includes/functions/settings-options.php:596 +#: includes/functions/settings-options.php:601 msgid "Enable Guest Email Notification ." msgstr "" -#: includes/functions/settings-options.php:602 +#: includes/functions/settings-options.php:607 msgid "Guest mail subject" msgstr "" -#: includes/functions/settings-options.php:603 +#: includes/functions/settings-options.php:608 msgid "This sets the subject of the emails sent to guest users" msgstr "" -#: includes/functions/settings-options.php:610 +#: includes/functions/settings-options.php:615 msgid "Guest mail body" msgstr "" -#: includes/functions/settings-options.php:611 +#: includes/functions/settings-options.php:616 msgid "" "This sets the body of the emails sent to guest users. Please DON'T edit the " "{activation_link} part, you can use {sitename} too." msgstr "" -#: includes/functions/settings-options.php:629 +#: includes/functions/settings-options.php:634 msgid "Post Types" msgstr "" -#: includes/functions/settings-options.php:630 +#: includes/functions/settings-options.php:635 msgid "Select the post types you will allow users to export." msgstr "" -#: includes/functions/settings-options.php:664 +#: includes/functions/settings-options.php:643 +msgid "AI Provider" +msgstr "" + +#: includes/functions/settings-options.php:644 +msgid "Select the AI service provider you want to use." +msgstr "" + +#: includes/functions/settings-options.php:652 +msgid "AI Model" +msgstr "" + +#: includes/functions/settings-options.php:653 +msgid "Select the AI model to use for content generation." +msgstr "" + +#: includes/functions/settings-options.php:661 +msgid "API Key" +msgstr "" + +#: includes/functions/settings-options.php:662 +msgid "Enter your AI service API key. Keep this secure and never share it publicly." +msgstr "" + +#: includes/functions/settings-options.php:696 msgid "" "Select profile/registration forms for user roles. These forms will be used " "to populate extra edit profile fields in backend." @@ -8119,14 +8358,6 @@ msgid "" "webmaster !" msgstr "" -#: templates/dashboard/billing-address.php:132 -msgid "Address Line 1" -msgstr "" - -#: templates/dashboard/billing-address.php:140 -msgid "Address Line 2" -msgstr "" - #: templates/dashboard/billing-address.php:155 #: templates/dashboard/billing-address.php:157 msgid "Postal/ZIP Code" @@ -9220,11 +9451,11 @@ msgstr "" msgid " or greater." msgstr "" -#: wpuf.php:256 +#: wpuf.php:260 msgid "Your WP User Frontend Pro is almost ready!" msgstr "" -#: wpuf.php:260 +#: wpuf.php:264 #. translators: 1: opening anchor tag, 2: closing anchor tag. msgid "" "We've pushed a major update on both WP User Frontend Free and WP " diff --git a/wpuf-functions.php b/wpuf-functions.php index ed62399e2..cea1e3e25 100644 --- a/wpuf-functions.php +++ b/wpuf-functions.php @@ -5706,3 +5706,117 @@ function wpuf_field_profile_photo_allowed_mimes() { return apply_filters( 'wpuf_field_profile_photo_allowed_mimes', $profile_photo_mimes ); } } + +/** + * Get AI provider configurations + * + * @since WPUF_SINCE + * + * @return array + */ +function wpuf_get_ai_provider_configs() { + $provider_configs = [ + 'openai' => [ + 'name' => 'OpenAI', + 'endpoint' => 'https://api.openai.com/v1/chat/completions', + 'models' => [ + 'gpt-4o' => 'GPT-4o - Most Capable Multimodal', + 'gpt-4o-mini' => 'GPT-4o Mini - Efficient & Fast', + 'gpt-4-turbo' => 'GPT-4 Turbo - High Performance', + 'gpt-4' => 'GPT-4 - Advanced Reasoning', + 'gpt-3.5-turbo' => 'GPT-3.5 Turbo - Fast & Affordable', + ], + 'requires_key' => true, + ], + 'anthropic' => [ + 'name' => 'Anthropic Claude', + 'endpoint' => 'https://api.anthropic.com/v1/messages', + 'models' => [ + 'claude-4.1-opus' => 'Claude 4.1 Opus - Most Capable', + 'claude-4-opus' => 'Claude 4 Opus - Best Coding Model', + 'claude-4-sonnet' => 'Claude 4 Sonnet - Advanced Reasoning', + 'claude-3.7-sonnet' => 'Claude 3.7 Sonnet - Hybrid Reasoning', + 'claude-3-5-sonnet-20241022' => 'Claude 3.5 Sonnet Latest', + 'claude-3-5-sonnet-20240620' => 'Claude 3.5 Sonnet', + 'claude-3-5-haiku-20241022' => 'Claude 3.5 Haiku', + 'claude-3-opus-20240229' => 'Claude 3 Opus', + 'claude-3-sonnet-20240229' => 'Claude 3 Sonnet', + 'claude-3-haiku-20240307' => 'Claude 3 Haiku', + ], + 'requires_key' => true, + ], + 'google' => [ + 'name' => 'Google Gemini', + 'endpoint' => 'https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent', + 'models' => [ + 'gemini-2.0-flash-exp' => 'Gemini 2.0 Flash Experimental - Latest', + 'gemini-2.0-flash' => 'Gemini 2.0 Flash - Stable', + 'gemini-2.0-flash-001' => 'Gemini 2.0 Flash 001 - Stable Version', + 'gemini-2.0-flash-lite-001' => 'Gemini 2.0 Flash-Lite 001 - Lightweight', + 'gemini-2.0-flash-lite' => 'Gemini 2.0 Flash-Lite - Lightweight', + 'gemini-2.5-flash' => 'Gemini 2.5 Flash - Latest Stable', + 'gemini-2.5-pro' => 'Gemini 2.5 Pro - Most Capable', + 'gemini-2.5-flash-lite' => 'Gemini 2.5 Flash-Lite - Efficient', + 'gemini-flash-latest' => 'Gemini Flash Latest - Auto-Updated', + 'gemini-pro-latest' => 'Gemini Pro Latest - Auto-Updated', + ], + 'requires_key' => true, + ], + ]; + return apply_filters( 'wpuf_ai_provider_configs', $provider_configs ); +} + +/** + * Get AI provider options for settings + * + * @since WPUF_SINCE + * + * @return array + */ +function wpuf_get_ai_provider_options() { + $configs = wpuf_get_ai_provider_configs(); + $options = []; + + foreach ( $configs as $key => $config ) { + $options[ $key ] = $config['name']; + } + + return $options; +} + +/** + * Get AI model options for settings + * + * @since WPUF_SINCE + * @return array + */ +function wpuf_get_ai_model_options() { + $configs = wpuf_get_ai_provider_configs(); + $all_models = []; + foreach ( $configs as $provider_key => $config ) { + foreach ( $config['models'] as $model_key => $model_name ) { + $all_models[ $model_key ] = $model_name; + } + } + + return apply_filters( 'wpuf_ai_model_options', $all_models ); +} + +/** + * AJAX handler to get AI provider configurations + * + * @since WPUF_SINCE + */ +function wpuf_get_ai_provider_configs_ajax() { + // Verify nonce for security + if ( ! wp_verify_nonce( $_POST['nonce'] ?? '', 'wpuf_nonce' ) ) { + wp_send_json_error( 'Invalid nonce' ); + } + // Check user capabilities + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( 'Insufficient permissions' ); + } + // Get AI provider configurations + $configs = wpuf_get_ai_provider_configs(); + wp_send_json_success( $configs ); +}