diff --git a/Classes/M12/Foundation/Fluid/Core/ViewHelper/TagBuilderAspect.php b/Classes/M12/Foundation/Fluid/Core/ViewHelper/TagBuilderAspect.php index e15118a..b0362e1 100644 --- a/Classes/M12/Foundation/Fluid/Core/ViewHelper/TagBuilderAspect.php +++ b/Classes/M12/Foundation/Fluid/Core/ViewHelper/TagBuilderAspect.php @@ -17,7 +17,7 @@ * Modifies globally how TagBuilder behaves for NULL attributes. * We're taking here the same strategy as with AttributesImplementation * - we don't want any attributes to render at all if the value - * was set to NULL. + * was set to NULL or FALSE. * * @see \TYPO3\Fluid\Core\ViewHelper\TagBuilder * @see \M12\Foundation\TypoScript\AttributesImplementation @@ -28,7 +28,7 @@ class TagBuilderAspect { /** * This changes how TagBuilder->addAttribute() method works. - * When attribute's value is NULL, it does *unset* the value. + * When attribute's value is NULL or FALSE, it does *unset* the value. * Otherwise addAttribute() method is called as usually. * * @param \TYPO3\Flow\AOP\JoinPointInterface $joinPoint @@ -36,7 +36,7 @@ class TagBuilderAspect { * @return void */ public function catchAddAttribute(\TYPO3\Flow\AOP\JoinPointInterface $joinPoint) { - if (NULL === $joinPoint->getMethodArgument('attributeValue')) { + if (NULL === $joinPoint->getMethodArgument('attributeValue') || FALSE === $joinPoint->getMethodArgument('attributeValue')) { /** @var \TYPO3\Fluid\Core\ViewHelper\TagBuilder $tagBuilder */ $tagBuilder = $joinPoint->getProxy(); $tagBuilder->removeAttribute($joinPoint->getMethodArgument('attributeName')); diff --git a/Classes/M12/Foundation/NodeTypePostprocessor/AbstractGridNodeTypePostprocessor.php b/Classes/M12/Foundation/NodeTypePostprocessor/AbstractGridNodeTypePostprocessor.php index 9b7f9f1..9b4ec05 100644 --- a/Classes/M12/Foundation/NodeTypePostprocessor/AbstractGridNodeTypePostprocessor.php +++ b/Classes/M12/Foundation/NodeTypePostprocessor/AbstractGridNodeTypePostprocessor.php @@ -62,28 +62,42 @@ public function injectSettings(array $settings) { public function process(NodeType $nodeType, array &$configuration, array $options) { $this->validateSettings(); - /** @var string $device: small, medium, large */ - foreach ($this->settings['devices'] as $device => $deviceData) { - foreach ($this->settings[static::$SETTINGS_SECTION] as $set => $setData) { - $propertyName = sprintf('class%s%s', ucfirst($device), ucfirst($set)); - $defaultValue = isset($setData['defaults'][$device]) ? $setData['defaults'][$device] : ''; - $configuration['properties'][$propertyName] = array( - 'type' => 'string', - 'defaultValue' => $defaultValue, - 'ui' => array( -// 'label' => $propertyName, - 'reloadIfChanged' => true, - 'inspector' => array( - 'group' => $setData['uiInspectorGroup'], - 'position' => 1, - 'editor' => 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor', - 'editorOptions' => $this->getEditorOptions($device, $set, $setData), - ), - ), - ); + $k = 0; + foreach ($this->settings[static::$SETTINGS_SECTION] as $set => $setData) { + $propertyName = sprintf('classGrid%s', ucfirst($set)); + + $editorValues = []; + $defaultValue = isset($setData['defaults']) ? $setData['defaults'] : ['']; + + /** @var string $device: small, medium, large */ + foreach ($this->settings['devices'] as $device => $deviceData) { + $groupLabel = $deviceData['label']; + $editorValues += $this->getEditorValues($set, $setData, $device, $groupLabel); } - } + $configuration['properties'][$propertyName] = [ + 'type' => 'array', + 'defaultValue' => $defaultValue, + 'ui' => [ + 'label' => $setData['label'], + 'reloadIfChanged' => true, + 'inspector' => [ + 'group' => $setData['uiInspectorGroup'], + 'position' => ($k+1)*10, + 'editor' => 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor', + 'editorOptions' => [ + 'multiple' => TRUE, + 'allowEmpty' => TRUE, + 'placeholder' => 'placeholder text...', + 'values' => $editorValues, + ], + ], + ], + ]; + + $k++; + } + // \TYPO3\Flow\var_dump($configuration); } @@ -95,12 +109,9 @@ public function process(NodeType $nodeType, array &$configuration, array $option * @param array $setData settings for the $set * @return array */ - protected function getEditorOptions($device, $set, array $setData) { - $editorOptions = array(); - - // empty 1st option - $editorOptions['placeholder'] = "- $device $set -"; - $editorOptions['values'][''] = array('label' => ''); + protected function getEditorValues($set, array $setData, $device, $groupLabel) { + $groupLabel = $groupLabel ? $groupLabel : $device; + $editorValues = []; $cssSuffixes = $this->settings[static::$SETTINGS_SECTION][$set]['cssClassSuffixes']; foreach ($cssSuffixes as $cssSuffix) { @@ -115,8 +126,9 @@ protected function getEditorOptions($device, $set, array $setData) { do { $valueName = $cssClass.$col; $labelName = $valueName; - $editorOptions['values'][$valueName] = array( + $editorValues[$valueName] = array( 'label' => $labelName, + 'group' => $groupLabel, ); $col++; } while (--$k); @@ -128,13 +140,14 @@ protected function getEditorOptions($device, $set, array $setData) { else { $valueName = $cssClass; $labelName = $valueName; - $editorOptions['values'][$valueName] = array( + $editorValues[$valueName] = array( 'label' => $labelName, + 'group' => $groupLabel, ); } } - return $editorOptions; + return $editorValues; } protected function validateSettings() { diff --git a/Classes/M12/Foundation/TypoScript/ContentCollectionImplementation.php b/Classes/M12/Foundation/TypoScript/ContentCollectionImplementation.php deleted file mode 100644 index 4ea4101..0000000 --- a/Classes/M12/Foundation/TypoScript/ContentCollectionImplementation.php +++ /dev/null @@ -1,136 +0,0 @@ -settings = $settings; - } - - /** - * Inside live workspace, it does NOT render extra DIV.content-collection. - * - * This is rather dirty/temporary hack as it breaks the rule, that rendered markup - * is the same in the Neos back-end and in the front-end. - * - * @return string - */ - public function evaluate() { - $contentCollectionNode = $this->getContentCollectionNode(); - if ($contentCollectionNode === null) { - return parent::evaluate(); - } - - $this->setDefaultProperties($contentCollectionNode); - - return parent::evaluate(); - } - - /** - * Set essential default properties on some nodes - * - * E.g. when Grid with 2 columns is inserted, it sets default size for each column, - * before user sets its own values. - * - * This is experimental, probably there's a better way to inject these properties. - * - * @param NodeInterface $contentCollectionNode - */ - protected function setDefaultProperties(NodeInterface $contentCollectionNode) { - $parentNode = $contentCollectionNode->getParent(); - $parentNodeType = $parentNode->getNodeType()->getName(); - $nodeType = $contentCollectionNode->getNodeType()->getName(); - - switch ($parentNodeType) { - // Set 1st tab as active tab (otherwise all are hidden and it's hard to add any content there. - case 'M12.Foundation:Tabs2': - case 'M12.Foundation:Tabs3': - case 'M12.Foundation:Tabs4': - case 'M12.Foundation:Tabs5': - case 'M12.Foundation:Tabs6': - // already set? - if ($contentCollectionNode->getProperty('activeTab')) - break; - - // otherwise check if any child has it set - /** @var NodeInterface[] $children */ - if (!($children = $parentNode->getChildNodes())) - return; - - foreach ($children as $node) { - if ($node->getProperty('activeTab')) - return; - } - - // pick up the 1st tab and mark it as active - $node = array_shift($children); - $node->setProperty('activeTab', true); - $this->persistenceManager->persistAll(); - break; - } - - switch ($nodeType) { - case 'M12.Foundation:Column': - case 'M12.Foundation:ColumnEnd': - $gridSize = $this->settings['gridSize']; - // extract num of columns from 'M12.Foundation:GridRowXCol' node type - $columns = (int)substr($parentNodeType, strlen('M12.Foundation:GridRow'), 1); - - // In case M12.Foundation:Column has been placed as a child of element - // different than M12.Foundation:GridColumnsX, make sure we do not divide by 0! - $defaultColumns = $columns ? floor($gridSize / $columns) : $gridSize; - - $sizeSettings = array(); - foreach (array_keys($this->settings['devices']) as $device) { - $name = 'class'.ucfirst($device).'Size'; - $sizeSettings[$name] = $contentCollectionNode->getProperty($name); - } - if (!array_filter($sizeSettings)) { - $keys = array_keys($sizeSettings); - $property = $keys[0]; - $contentCollectionNode->setProperty($property, 'small-'.$defaultColumns); - $this->persistenceManager->persistAll(); - } - break; - } - } -} diff --git a/Classes/M12/Foundation/TypoScript/MenuImplementation.php b/Classes/M12/Foundation/TypoScript/MenuImplementation.php index 682896b..184acc0 100644 --- a/Classes/M12/Foundation/TypoScript/MenuImplementation.php +++ b/Classes/M12/Foundation/TypoScript/MenuImplementation.php @@ -33,7 +33,7 @@ protected function buildMenuLevelRecursive(array $menuLevelCollection) { $item['cssClasses'] = ''; /** @var NodeInterface $node */ - $node = $item['originalNode']; + $node = $item['node']; // // [FEATURE] diff --git a/Classes/M12/Foundation/TypoScript/AttributesImplementation.php b/Classes/M12/Foundation/TypoScriptObjects/AttributesImplementation.php similarity index 71% rename from Classes/M12/Foundation/TypoScript/AttributesImplementation.php rename to Classes/M12/Foundation/TypoScriptObjects/AttributesImplementation.php index d495a64..f318f45 100644 --- a/Classes/M12/Foundation/TypoScript/AttributesImplementation.php +++ b/Classes/M12/Foundation/TypoScriptObjects/AttributesImplementation.php @@ -1,5 +1,5 @@ parseCustomUserAttributes(); + $allowEmpty = $this->getAllowEmpty(); $attributes = array(); $renderedAttributes = ''; foreach (array_keys($this->properties) as $attributeName) { + if ($attributeName === '__meta') continue; + $encodedAttributeName = htmlspecialchars($attributeName, ENT_COMPAT, 'UTF-8', FALSE); $attributeValue = $this->tsValue($attributeName); - if (null === $attributeValue) { - continue; - } else if (is_string($attributeValue) && 0 === strlen($attributeValue)) { + if ($attributeValue === NULL || $attributeValue === FALSE) { + // No op + } elseif ($attributeValue === TRUE || $attributeValue === '') { $attributes[$attributeName] = $attributeValue; - $renderedAttributes .= ' ' . $encodedAttributeName; + $renderedAttributes .= ' ' . $encodedAttributeName . ($allowEmpty ? '' : '=""'); } else { if (is_array($attributeValue)) { - $attributeValue = implode(' ', $attributeValue); + $joinedAttributeValue = ''; + foreach ($attributeValue as $attributeValuePart) { + if ((string)$attributeValuePart !== '') { + $joinedAttributeValue .= ' ' . trim($attributeValuePart); + } + } + $attributeValue = trim($joinedAttributeValue); } $encodedAttributeValue = htmlspecialchars($attributeValue, ENT_COMPAT, 'UTF-8', FALSE); - + $attributes[$attributeName] = $attributeValue; $renderedAttributes .= ' ' . $encodedAttributeName . '="' . $encodedAttributeValue . '"'; } diff --git a/Configuration/NodeTypes.Abstracts.yaml b/Configuration/NodeTypes.Abstracts.yaml index c26d297..6c97bdb 100644 --- a/Configuration/NodeTypes.Abstracts.yaml +++ b/Configuration/NodeTypes.Abstracts.yaml @@ -7,14 +7,19 @@ inspector: groups: dev: - label: 'Advanced' + label: 'Advanced settings' position: 95 + tab: dev + devCode: + label: 'Custom code' + position: 95 + tab: dev properties: - customHtmlId: + customCssClass: type: string defaultValue: '' ui: - label: 'Wrapper custom HTML ID' + label: 'Element custom CSS class(es)' reloadIfChanged: TRUE inspector: group: 'dev' @@ -24,43 +29,43 @@ placeholder: 'None' validation: regularExpression: - regularExpression: '/^[a-z0-9\-]+$/i' - customCssClass: + regularExpression: '/^[a-z0-9\- ]+$/i' + customHtmlId: type: string defaultValue: '' ui: - label: 'Wrapper custom class(es)' + label: 'Element custom HTML ID' reloadIfChanged: TRUE inspector: group: 'dev' - position: 20 + position: 11 editor: Content/Inspector/Editors/TextFieldEditor editorOptions: placeholder: 'None' validation: regularExpression: - regularExpression: '/^[a-z0-9\- ]+$/i' + regularExpression: '/^[a-z0-9\-]+$/i' customCssCode: type: string defaultValue: '' ui: - label: 'Wrapper inline CSS' + label: 'Element inline CSS' reloadIfChanged: TRUE inspector: - group: 'dev' + group: 'devCode' position: 30 editor: Content/Inspector/Editors/TextFieldEditor editorOptions: - placeholder: 'None' + placeholder: 'e.g. margin-top: 3rem' customUserAttributes: type: string ui: - label: 'Custom attributes (one per line)' + label: 'Element extra attributes (one per line)' reloadIfChanged: TRUE inspector: - group: 'dev' + group: 'devCode' position: 40 - editor: 'M12.Foundation/Inspector/Editors/TextAreaEditor' + editor: 'Content/Inspector/Editors/TextAreaEditor' editorOptions: placeholder: 'e.g. custom-data-attribute=value' @@ -70,25 +75,24 @@ ui: inspector: groups: - dev: - label: 'Advanced' - position: 95 + devView: + position: 10 + tab: dev + label: 'Custom look' properties: customLook: type: string - defaultValue: '' ui: label: 'Predefined style / look' reloadIfChanged: TRUE inspector: - group: 'dev' + group: 'devView' position: 40 editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: placeholder: 'None' + allowEmpty: TRUE values: - '': - label: '' style-1: label: 'Style 1' style-2: @@ -105,25 +109,24 @@ ui: inspector: groups: - dev: - label: 'Advanced' - position: 95 + devSemantic: + label: 'Semantic Web' + position: 96 + tab: dev properties: customTagName: type: string - defaultValue: 'div' ui: - label: 'Wrapper semantic tag type' + label: 'Element semantic tag type' reloadIfChanged: TRUE inspector: - group: 'dev' + group: 'devSemantic' position: 50 editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: placeholder: 'Default / None' + allowEmpty: TRUE values: - '': - label: '' main: label: 'MAIN' header: @@ -140,9 +143,12 @@ label: 'FOOTER' # -# Mixin for content nodes where 'magellanSupport' property is needed +# Mixin: +# Navigation: #fragment, magellan support # -'M12.Foundation:AbstractNavMagellanSupport': +'M12.Foundation:AbstractNavSailingType': + superTypes: + - 'M12.Foundation:AbstractNavFragmentId' abstract: TRUE properties: magellanSupport: @@ -152,6 +158,7 @@ reloadIfChanged: TRUE inspector: group: 'sailingOptions' + position: 9 # # Mixin for document/content nodes with 'fragmentId' property @@ -160,6 +167,13 @@ # 'M12.Foundation:AbstractNavFragmentId': abstract: TRUE + ui: + inspector: + groups: + sailingOptions: + label: 'Sailing options' + position: 96 + tab: meta properties: fragmentId: type: string @@ -185,6 +199,12 @@ # 'M12.Foundation:AbstractNavFixedSticky': abstract: TRUE + ui: + inspector: + groups: + menuPosition: + label: 'Menu positioning' + position: 31 # After Neos menu 'options' group properties: classNavFixed: type: boolean @@ -192,31 +212,14 @@ label: 'Fixed' reloadIfChanged: TRUE inspector: - group: 'options' + group: 'menuPosition' classNavSticky: type: boolean ui: label: 'Sticky' reloadIfChanged: TRUE inspector: - group: 'options' - -# -# Mixin: -# Navigation: #fragment, magellan support -# -'M12.Foundation:AbstractNavSailingType': - superTypes: - - 'M12.Foundation:AbstractNavFragmentId' - - 'M12.Foundation:AbstractNavMagellanSupport' - abstract: TRUE - ui: - inspector: - groups: - sailingOptions: - label: 'Sailing options' - position: 96 - + group: 'menuPosition' # # Mixin: Font Awesome icon @@ -227,9 +230,9 @@ inspector: groups: fontIconOptions: - label: 'Font Awesome icon' - # Put this group somewhere in the middle... - position: 96 + label: 'FontAwesome.io icon' + position: 90 + tab: view properties: faName: type: string @@ -240,77 +243,67 @@ group: 'fontIconOptions' editorOptions: placeholder: '...as listed on fontawesome.io' - faSize: - type: string + faOptions: + type: array + defaultValue: [''] ui: + label: 'Icon options' reloadIfChanged: TRUE inspector: group: 'fontIconOptions' editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: - placeholder: 'Icon size' + placeholder: 'Icon options' + allowEmpty: TRUE values: - '': - label: '' + # Icon size fa-lg: label: 'Size: large' + group: 'Icon size' fa-2x: label: 'Size: x2' + group: 'Icon size' fa-3x: label: 'Size: x3' + group: 'Icon size' fa-4x: label: 'Size: x4' + group: 'Icon size' fa-5x: label: 'Size: x5' - faRotation: - type: string - ui: - reloadIfChanged: TRUE - inspector: - group: 'fontIconOptions' - editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' - editorOptions: - placeholder: 'Icon rotation' - values: - '': - label: '' + group: 'Icon size' + # Icon rotation: fa-rotate-90: label: 'Rotate 90 degree' + group: 'Icon rotation' fa-rotate-180: label: 'Rotate 180 degree' + group: 'Icon rotation' fa-rotate-270: label: 'Rotate 270 degree' + group: 'Icon rotation' fa-flip-horizontal: label: 'Flip horizontal' + group: 'Icon rotation' fa-flip-vertical: label: 'Flip vertical' + group: 'Icon rotation' + # Make it... + fa-spin: + label: 'a spinner' + group: 'Make it...' + fa-fw: + label: 'have a fixed width' + group: 'Make it...' + right: + label: 'right aligned' + group: 'Make it...' faCustomCss: type: string ui: - label: 'Font Awesome icon custom css' + label: 'Icon custom inline CSS' reloadIfChanged: TRUE inspector: group: 'fontIconOptions' editorOptions: placeholder: 'e.g. padding-right: 5px;' - faSpin: - type: boolean - ui: - label: 'Make it a spinner' - reloadIfChanged: TRUE - inspector: - group: 'fontIconOptions' - faFixedWidth: - type: boolean - ui: - label: 'Make it have a fixed with' - reloadIfChanged: TRUE - inspector: - group: 'fontIconOptions' - faRightAlign: - type: boolean - ui: - label: 'Make it right aligned' - reloadIfChanged: TRUE - inspector: - group: 'fontIconOptions' diff --git a/Configuration/NodeTypes.Buttons.yaml b/Configuration/NodeTypes.Buttons.yaml index 4b24eb7..3b1c53e 100644 --- a/Configuration/NodeTypes.Buttons.yaml +++ b/Configuration/NodeTypes.Buttons.yaml @@ -9,20 +9,20 @@ - 'M12.Foundation:AbstractNavSailingType' - 'M12.Foundation:AbstractFontIcon' ui: - label: 'Button & Link' - icon: 'icon-minus' + label: 'Button / Link' + icon: 'icon-sign-blank' group: 'foundationButtons' inspector: groups: options: label: 'Button options' position: 6 - dev: - label: 'Button advanced options' - position: 7 extraOptions: label: 'Reveal & Dropdown options' position: 8 + constraints: + nodeTypes: + '*': FALSE # No children items allowed properties: label: type: string @@ -32,108 +32,126 @@ inspector: group: 'options' aloha: - 'format': ['b', 'i', 'u', 'sub', 'sup'] - 'link': - 'a': FALSE - renderAnchor: - type: boolean - ui: - label: 'Render as an anchor (link)' - reloadIfChanged: TRUE - inspector: - group: 'options' + format: + strong: TRUE + em: TRUE + u: TRUE + sub: TRUE + sup: TRUE + p: FALSE + h1: FALSE + h2: FALSE + h3: FALSE + h4: FALSE + h5: FALSE + link: + a: FALSE + alignment: + left: FALSE + center: FALSE + right: FALSE + justify: FALSE + formatlesspaste: + button: FALSE + formatlessPasteOption: TRUE + autoparagraph: FALSE buttonType: type: string - defaultValue: '' ui: - label: 'Button type' + label: '' reloadIfChanged: TRUE inspector: group: 'options' editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: - placeholder: 'Default' + placeholder: 'Button type' + allowEmpty: TRUE values: - '': - label: '' + button: + label: 'Type: Button' submit: - label: 'Submit' + label: 'Type: Submit' reset: - label: 'Reset' - button: - label: 'Button' - classSize: - type: string - defaultValue: '' + label: 'Type: Reset' + renderAnchor: + type: boolean ui: - label: 'Button size' + label: 'Render as an anchor (link)' reloadIfChanged: TRUE inspector: group: 'options' - editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' - editorOptions: - placeholder: 'Default' - values: - '': - label: '' - tiny: - label: 'Tiny' - small: - label: 'Small' - large: - label: 'Large' - classAppearance: - type: string - defaultValue: '' + classOptions: + type: array + defaultValue: [''] ui: - label: 'Button appearance' + label: '' reloadIfChanged: TRUE inspector: group: 'options' editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: - placeholder: 'Default' + placeholder: 'Button options' + allowEmpty: TRUE values: - '': - label: '' - primary: - label: 'Primary' + tiny: + label: 'Size: Tiny' + group: 'Size' + small: + label: 'Size: Small' + group: 'Size' + large: + label: 'Size: Large' + group: 'Size' success: - label: 'Success' + label: 'Appearance: Success' + group: 'Appearance' + secondary: + label: 'Appearance: Secondary' + group: 'Appearance' alert: - label: 'Alert' - classShape: - type: string - defaultValue: '' - ui: - label: 'Button shape' - reloadIfChanged: TRUE - inspector: - group: 'options' - editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' - editorOptions: - placeholder: 'Default' - values: - '': - label: '' + label: 'Appearance: Alert' + group: 'Appearance' + info: + label: 'Appearance: Info' + group: 'Appearance' + disabled: + label: 'Appearance: Disabled' + group: 'Appearance' radius: - label: 'Radius' + label: 'Shape: Radius' + group: 'Shape' round: - label: 'Round' + label: 'Shape: Round' + group: 'Shape' + # Form options: prefix/postfix when used together with form fields + prefix: + label: 'Form: Prefix button' + group: 'Form options' + postfix: + label: 'Form: Postfix button' + group: 'Form options' + dropdown: + label: 'Render as dropdown button' + group: 'Dropdown options' + split: + label: 'Render as split button' + group: 'Dropdown options' + expand: + label: 'Expanded button' + group: 'Misc' htmlHref: type: string - defaultValue: '' ui: label: 'Link' reloadIfChanged: TRUE inspector: group: 'options' + # TODO: Replace with LinkEditor when it is fixed (Neos 1.2.0: seems to be buggy, does not allow external URLs) editor: 'TYPO3.Neos/Inspector/Editors/TextFieldEditor' editorOptions: placeholder: 'e.g. http://www.example.com' htmlTargetBlank: type: string - defaultValue: '' ui: label: 'Open in new window' reloadIfChanged: TRUE @@ -142,25 +160,10 @@ editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: placeholder: 'No' + allowEmpty: TRUE values: - '': - label: '' _blank: label: 'Yes' - classIsDisabled: - type: boolean - ui: - label: 'Disable' - reloadIfChanged: TRUE - inspector: - group: 'options' - classIsExpanded: - type: boolean - ui: - label: 'Expand' - reloadIfChanged: TRUE - inspector: - group: 'options' # Reveal Modal related properties. htmlDataRevealId: type: string @@ -185,9 +188,15 @@ editor: 'TYPO3.Neos/Inspector/Editors/TextFieldEditor' editorOptions: placeholder: 'e.g. myDropdown' + dropdownHoverable: + type: boolean + ui: + label: 'Dropdown hoverable' + reloadIfChanged: TRUE + inspector: + group: 'extraOptions' dropdownDirection: type: string - defaultValue: '' ui: label: 'Dropdown direction' reloadIfChanged: TRUE @@ -196,9 +205,8 @@ editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: placeholder: 'Default / Bottom' + allowEmpty: TRUE values: - '': - label: '' 'top': label: 'Top' 'right': @@ -207,41 +215,9 @@ label: 'Bottom' 'left': label: 'Left' - dropdownHoverable: - type: boolean - ui: - label: 'Dropdown hoverable' - reloadIfChanged: TRUE - inspector: - group: 'extraOptions' - isButtonSplit: - type: boolean - ui: - label: 'Render as split button' - reloadIfChanged: TRUE - inspector: - group: 'extraOptions' - isButtonDropdown: - type: boolean - ui: - label: 'Render as dropdown button' - reloadIfChanged: TRUE - inspector: - group: 'extraOptions' - # Override inherited properties from M12.Foundation:AbstractDevBase - customHtmlId: - ui: - label: 'Element custom ID' - customCssClass: - ui: - label: 'Element extra CSS class(es)' - customCssCode: - ui: - label: 'Element inline CSS' - # Override inherited properties from M12.Foundation:AbstractDevBase -# Button Group +# Button Group (list of buttons) 'M12.Foundation:ButtonGroup': superTypes: - 'TYPO3.Neos:Content' @@ -249,12 +225,16 @@ label: 'Button Group' icon: 'icon-minus' group: 'foundationButtons' + inlineEditable: TRUE + constraints: + nodeTypes: + 'M12.Foundation:Button': TRUE + '*': FALSE childNodes: - content: - type: 'TYPO3.Neos:ContentCollection' + btn1: + type: 'M12.Foundation:Button' - -# Button Bar +# Button Bar (group of button groups) 'M12.Foundation:ButtonBar': superTypes: - 'TYPO3.Neos:Content' @@ -262,7 +242,13 @@ label: 'Button Bar' icon: 'icon-minus' group: 'foundationButtons' + inlineEditable: TRUE + constraints: + nodeTypes: + 'M12.Foundation:ButtonGroup': TRUE + '*': FALSE childNodes: - content: - type: 'TYPO3.Neos:ContentCollection' - + group1: + type: 'M12.Foundation:ButtonGroup' + group2: + type: 'M12.Foundation:ButtonGroup' diff --git a/Configuration/NodeTypes.Callouts.yaml b/Configuration/NodeTypes.Callouts.yaml index 5029fca..c1fcdf8 100644 --- a/Configuration/NodeTypes.Callouts.yaml +++ b/Configuration/NodeTypes.Callouts.yaml @@ -13,11 +13,15 @@ label: 'Reveal Modal' icon: 'icon-fullscreen' group: 'foundationCalloutsPrompts' + inlineEditable: TRUE inspector: groups: options: label: 'Reveal Modal options' position: 9 + constraints: + nodeTypes: + '*': FALSE # All content must go into child ContentCollection childNodes: content: type: 'TYPO3.Neos:ContentCollection' @@ -62,11 +66,15 @@ label: 'Alert' icon: 'icon-warning-sign' group: 'foundationCalloutsPrompts' + inlineEditable: TRUE inspector: groups: options: label: 'Alert box options' position: 9 + constraints: + nodeTypes: + '*': FALSE # All content must go into child ContentCollection childNodes: content: type: 'TYPO3.Neos:ContentCollection' @@ -101,11 +109,15 @@ label: 'Panel' icon: 'icon-check-empty' group: 'foundationCalloutsPrompts' + inlineEditable: TRUE inspector: groups: options: label: 'Panel options' position: 9 + constraints: + nodeTypes: + '*': FALSE # All content must go into child ContentCollection childNodes: content: type: 'TYPO3.Neos:ContentCollection' @@ -113,7 +125,7 @@ classCallout: type: boolean ui: - label: 'Callout' + label: 'Style: callout' reloadIfChanged: TRUE inspector: group: 'options' diff --git a/Configuration/NodeTypes.Content.yaml b/Configuration/NodeTypes.Content.yaml index 202f9ee..a359cb1 100644 --- a/Configuration/NodeTypes.Content.yaml +++ b/Configuration/NodeTypes.Content.yaml @@ -6,30 +6,32 @@ # Dropdown abstract 'M12.Foundation:DropdownAbstract': + label: "${'Dropdown: ' + q(node).property('customHtmlId')}" abstract: TRUE superTypes: - 'M12.Foundation:AbstractDevBase' ui: inspector: groups: - dev: + dropdownOptions: label: 'Dropdown options' position: 9 + constraints: + nodeTypes: + '*': FALSE # No children items allowed properties: dropdownSize: type: string - defaultValue: '' ui: - label: 'Size' + label: 'Dropdown content size' reloadIfChanged: TRUE inspector: - group: 'dev' + group: 'dropdownOptions' editor: 'TYPO3.Neos/Inspector/Editors/SelectBoxEditor' editorOptions: placeholder: 'Default / Tiny' + allowEmpty: TRUE values: - '': - label: '' tiny: label: 'Tiny' small: @@ -38,16 +40,11 @@ label: 'Medium' large: label: 'Large' - # Override inherited properties from M12.Foundation:AbstractDevBase customHtmlId: ui: - label: 'Element custom ID' - customCssClass: - ui: - label: 'Element extra CSS class(es)' - customCssCode: - ui: - label: 'Element inline CSS' + label: 'Dropdown element ID' + inspector: + group: 'dropdownOptions' # Dropdown that can handle list of links only. @@ -56,36 +53,44 @@ - 'TYPO3.Neos:Content' - 'M12.Foundation:DropdownAbstract' ui: - label: 'Dropdown' - icon: 'icon-minus' + label: 'Dropdown: Links' + icon: 'icon-sort-down' group: 'foundationContent' properties: text: type: string - defaultValue: '' + defaultValue: | + ui: inlineEditable: TRUE aloha: - 'format': - 'b': TRUE - 'i': TRUE - 'u': TRUE - 'sub': FALSE - 'sup': FALSE - 'p': FALSE - 'h1': FALSE - 'h2': FALSE - 'h3': FALSE - 'pre': FALSE - 'removeFormat': TRUE - 'table': - 'table': FALSE - 'list': - 'ol': FALSE - 'ul': TRUE - 'link': - 'a': TRUE - + format: + strong: TRUE + em: TRUE + u: TRUE + sub: TRUE + sup: TRUE + p: FALSE + h1: FALSE + h2: FALSE + h3: FALSE + h4: FALSE + h5: FALSE + link: + a: TRUE + alignment: + left: FALSE + center: FALSE + right: FALSE + justify: FALSE + formatlesspaste: + button: FALSE + formatlessPasteOption: TRUE + autoparagraph: FALSE # Dropdown that can handle custom content. 'M12.Foundation:DropdownContent': @@ -93,9 +98,10 @@ - 'TYPO3.Neos:Content' - 'M12.Foundation:DropdownAbstract' ui: - label: 'Dropdown Content' - icon: 'icon-minus' + label: 'Dropdown: Content' + icon: 'icon-collapse' group: 'foundationContent' + inlineEditable: TRUE childNodes: content: type: 'TYPO3.Neos:ContentCollection' @@ -107,7 +113,7 @@ label: 'Add padding to dropdown container' reloadIfChanged: TRUE inspector: - group: 'dev' + group: 'dropdownOptions' @@ -124,9 +130,6 @@ accordionSettings: label: 'Accordion settings' position: 9 - childNodes: - content: - type: 'TYPO3.Neos:ContentCollection' 'M12.Foundation:Accordion': superTypes: @@ -134,8 +137,16 @@ - 'M12.Foundation:AccordionAbstract' ui: label: 'Accordion' - icon: 'icon-minus' + icon: 'icon-reorder' group: 'foundationContent' + inlineEditable: TRUE + constraints: + nodeTypes: + 'M12.Foundation:AccordionItem': TRUE + '*': FALSE # No children items allowed + childNodes: + content: + type: 'M12.Foundation:AccordionItem' properties: accordionGroupName: type: string @@ -144,6 +155,8 @@ reloadIfChanged: TRUE inspector: group: 'accordionSettings' + editorOptions: + placeholder: '...for distributed accordion groups only' validation: regularExpression: regularExpression: '/^[a-z0-9\-]+$/i' @@ -155,18 +168,45 @@ - 'M12.Foundation:AccordionAbstract' ui: label: 'Accordion Item' - icon: 'icon-minus' + icon: 'icon-reorder' group: 'foundationContent' + constraints: + nodeTypes: + '*': FALSE # No children items allowed apart of child ContentCollection + childNodes: + content: + type: 'TYPO3.Neos:ContentCollection' properties: accordionItemLabel: type: string defaultValue: 'Accordion item label' ui: - inlineEditable: TRUE + inspector: + group: 'accordionSettings' aloha: - 'format': ['b', 'i', 'u', 'sub', 'sup'] - 'link': - 'a': FALSE + format: + strong: TRUE + em: TRUE + u: TRUE + sub: TRUE + sup: TRUE + p: FALSE + h1: FALSE + h2: FALSE + h3: FALSE + h4: FALSE + h5: FALSE + link: + a: FALSE + alignment: + left: FALSE + center: FALSE + right: FALSE + justify: FALSE + formatlesspaste: + button: FALSE + formatlessPasteOption: TRUE + autoparagraph: FALSE accordionItemId: type: string ui: @@ -179,6 +219,7 @@ regularExpression: '/^[a-z0-9\-]+$/i' isAccordionItemActive: type: boolean + defaultValue: TRUE ui: label: 'Make this accordion item active' reloadIfChanged: TRUE @@ -189,18 +230,20 @@ # ----------------------------------------------------------------------------- # Tabs # ----------------------------------------------------------------------------- -'M12.Foundation:TabContentItem': +'M12.Foundation:TabItem': superTypes: - 'TYPO3.Neos:Content' ui: - label: 'Tabs Item' + label: 'Tab Item' icon: 'icon-angle-right' - group: 'na' inspector: groups: tabSettings: label: 'Tab item options' position: 9 + constraints: + nodeTypes: + '*': FALSE # All content must go to child ContentCollection childNodes: content: type: 'TYPO3.Neos:ContentCollection' @@ -222,8 +265,7 @@ position: 20 -'M12.Foundation:TabsAbstract': - abstract: TRUE +'M12.Foundation:Tabs': superTypes: - 'TYPO3.Neos:Content' - 'M12.Foundation:AbstractDevCustomTag' @@ -238,6 +280,15 @@ tabSettings: label: 'Tab item options' position: 9 + constraints: + nodeTypes: + 'M12.Foundation:TabItem': TRUE + '*': FALSE + childNodes: + tab1: + type: 'M12.Foundation:TabItem' + tab2: + type: 'M12.Foundation:TabItem' properties: vertical: type: boolean @@ -249,82 +300,6 @@ position: 10 -'M12.Foundation:Tabs2': - superTypes: - - 'M12.Foundation:TabsAbstract' - ui: - label: 'Tabs 2' - childNodes: - tab1: - type: 'M12.Foundation:TabContentItem' - tab2: - type: 'M12.Foundation:TabContentItem' - -'M12.Foundation:Tabs3': - superTypes: - - 'M12.Foundation:TabsAbstract' - ui: - label: 'Tabs 3' - childNodes: - tab1: - type: 'M12.Foundation:TabContentItem' - tab2: - type: 'M12.Foundation:TabContentItem' - tab3: - type: 'M12.Foundation:TabContentItem' - -'M12.Foundation:Tabs4': - superTypes: - - 'M12.Foundation:TabsAbstract' - ui: - label: 'Tabs 4' - childNodes: - tab1: - type: 'M12.Foundation:TabContentItem' - tab2: - type: 'M12.Foundation:TabContentItem' - tab3: - type: 'M12.Foundation:TabContentItem' - tab4: - type: 'M12.Foundation:TabContentItem' - -'M12.Foundation:Tabs5': - superTypes: - - 'M12.Foundation:TabsAbstract' - ui: - label: 'Tabs 5' - childNodes: - tab1: - type: 'M12.Foundation:TabContentItem' - tab2: - type: 'M12.Foundation:TabContentItem' - tab3: - type: 'M12.Foundation:TabContentItem' - tab4: - type: 'M12.Foundation:TabContentItem' - tab5: - type: 'M12.Foundation:TabContentItem' - -'M12.Foundation:Tabs6': - superTypes: - - 'M12.Foundation:TabsAbstract' - ui: - label: 'Tabs 6' - childNodes: - tab1: - type: 'M12.Foundation:TabContentItem' - tab2: - type: 'M12.Foundation:TabContentItem' - tab3: - type: 'M12.Foundation:TabContentItem' - tab4: - type: 'M12.Foundation:TabContentItem' - tab5: - type: 'M12.Foundation:TabContentItem' - tab6: - type: 'M12.Foundation:TabContentItem' - - # ----------------------------------------------------------------------------- # Font Awesome Icon # ----------------------------------------------------------------------------- @@ -334,13 +309,15 @@ - 'M12.Foundation:AbstractFontIcon' ui: label: 'Font Awesome icon' - icon: 'icon-minus' + icon: 'icon-flag' group: 'foundationContent' inspector: groups: fontIconOptions: # Put this group at the very beginning for this content element + # Also move it to the very 1st, default tab position: 10 + tab: default properties: faName: defaultValue: 'circle-o-notch' diff --git a/Configuration/NodeTypes.Forms.yaml b/Configuration/NodeTypes.Forms.yaml index 23e991c..8fddc1e 100644 --- a/Configuration/NodeTypes.Forms.yaml +++ b/Configuration/NodeTypes.Forms.yaml @@ -19,6 +19,9 @@ formSettings: label: 'Form settings' position: 5 + constraints: + nodeTypes: + '*': FALSE # All content must go into child ContentCollection childNodes: content: type: 'TYPO3.Neos:ContentCollection' @@ -32,6 +35,7 @@ group: 'formSettings' methodType: type: string + defaultValue: 'get' ui: label: 'Submit method' reloadIfChanged: TRUE @@ -60,21 +64,24 @@ dev: label: 'Advanced form element settings' position: 9 + constraints: + nodeTypes: + '*': FALSE # All content must go into child ContentCollection properties: inputName: type: string - defaultValue: 'input-name' ui: - label: 'Name attribute' + label: 'Element name attribute' reloadIfChanged: TRUE inspector: - group: 'formInputSettings' + group: 'dev' position: 10 + editorOptions: + placeholder: 'None' inputValue: type: string - defaultValue: '' ui: - label: 'Value attribute' + label: 'Field value' reloadIfChanged: TRUE inspector: group: 'formInputSettings' @@ -118,19 +125,6 @@ inspector: group: 'formInputSettings' position: 80 - # Override inherited properties from M12.Foundation:AbstractDevBase - customHtmlId: - ui: - label: 'Element custom ID' - customCssClass: - ui: - label: 'Element extra CSS class(es)' - customCssCode: - ui: - label: 'Element inline CSS' - customLook: - ui: - label: 'Element predefined style / look' # Abstract for all form elements that need