@aglyn/plugins-mui 1.0.0-beta.263 → 1.0.0-beta.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-mui",
3
- "version": "1.0.0-beta.263",
3
+ "version": "1.0.0-beta.266",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,12 +25,12 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/aglyn": "1.0.0-beta.263",
29
- "@aglyn/shared-data-enums": "1.0.0-beta.263",
30
- "@aglyn/shared-data-mdi": "1.0.0-beta.263",
31
- "@aglyn/shared-ui-jsx": "1.0.0-beta.263",
32
- "@aglyn/shared-ui-theme": "1.0.0-beta.263",
33
- "@aglyn/shared-util-vendor": "1.0.0-beta.263",
28
+ "@aglyn/aglyn": "1.0.0-beta.266",
29
+ "@aglyn/shared-data-enums": "1.0.0-beta.266",
30
+ "@aglyn/shared-data-mdi": "1.0.0-beta.266",
31
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.266",
32
+ "@aglyn/shared-ui-theme": "1.0.0-beta.266",
33
+ "@aglyn/shared-util-vendor": "1.0.0-beta.266",
34
34
  "@swc/helpers": "0.5.23",
35
35
  "dayjs": "^1.11.23",
36
36
  "mobx": "^7.0.5",
@@ -36,6 +36,10 @@ export interface SearchBoxProps {
36
36
  * form post the editor never triggers). Once hydrated the submit goes
37
37
  * through the client router, so the site's chrome stays mounted rather than
38
38
  * the whole document reloading for a results page.
39
+ *
40
+ * The form is an MUI Box so the element's style settings (`sx`, including a
41
+ * per-breakpoint display or width) style it, as they do every other element
42
+ * (AGL-3917).
39
43
  */
40
44
  declare const SearchBox: import("react").ForwardRefExoticComponent<SearchBoxProps & import("react").RefAttributes<HTMLFormElement>>;
41
45
  export declare const schema: Aglyn.ComponentSchema<SearchBoxProps>;
@@ -18,6 +18,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  * limitations under the License.
19
19
  */ import * as Aglyn from "@aglyn/aglyn";
20
20
  import { mdiMagnify } from "@aglyn/shared-data-mdi";
21
+ import Box from "@mui/material/Box";
21
22
  import IconButton from "@mui/material/IconButton";
22
23
  import InputAdornment from "@mui/material/InputAdornment";
23
24
  import TextField from "@mui/material/TextField";
@@ -35,13 +36,18 @@ export const ID = 'searchBox';
35
36
  * form post the editor never triggers). Once hydrated the submit goes
36
37
  * through the client router, so the site's chrome stays mounted rather than
37
38
  * the whole document reloading for a results page.
39
+ *
40
+ * The form is an MUI Box so the element's style settings (`sx`, including a
41
+ * per-breakpoint display or width) style it, as they do every other element
42
+ * (AGL-3917).
38
43
  */ const SearchBox = /*#__PURE__*/ forwardRef((props, ref)=>{
39
44
  const { placeholder, defaultValue } = props, rest = _object_without_properties_loose(props, [
40
45
  "placeholder",
41
46
  "defaultValue"
42
47
  ]);
43
48
  const onSubmit = useSoftGetSubmit();
44
- return /*#__PURE__*/ _jsx("form", _extends({
49
+ return /*#__PURE__*/ _jsx(Box, _extends({
50
+ component: "form",
45
51
  ref: ref,
46
52
  action: "/search",
47
53
  method: "get",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/search-box.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiMagnify } from '@aglyn/shared-data-mdi'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport TextField from '@mui/material/TextField'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { useSoftGetSubmit } from '@aglyn/shared-ui-jsx/hooks/use-soft-get-submit'\nimport { forwardRef } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = 'searchBox'\n\nexport interface SearchBoxProps {\n placeholder?: string\n /**\n * What the field starts with (AGL-2513). The results page prefills the\n * query it is showing, so a reader can refine it where they are rather\n * than going back for the box they typed into.\n *\n * Uncontrolled on purpose: this component holds no state and issues no\n * request, and a `value` would freeze the field the moment the reader\n * typed into it.\n */\n defaultValue?: string\n}\n\n/**\n * Site search box (AGL-88): a plain GET form to the tenant's /search page,\n * so it works with zero JavaScript and is inert in the besigner (the\n * console has no /search route to submit to; navigation there is a no-op\n * form post the editor never triggers). Once hydrated the submit goes\n * through the client router, so the site's chrome stays mounted rather than\n * the whole document reloading for a results page.\n */\nconst SearchBox = forwardRef<HTMLFormElement, SearchBoxProps>(\n (props, ref) => {\n const { placeholder, defaultValue, ...rest } = props\n const onSubmit = useSoftGetSubmit()\n return (\n <form\n ref={ref}\n action=\"/search\"\n method=\"get\"\n role=\"search\"\n onSubmit={onSubmit}\n {...rest}\n >\n <TextField\n // Keyed by the starting text. A submit is a client navigation, so\n // this uncontrolled field can outlive the query it was mounted\n // with; a new key is what makes it re-read `defaultValue`.\n key={defaultValue || ''}\n name=\"q\"\n size=\"small\"\n placeholder={placeholder || 'Search…'}\n defaultValue={defaultValue || ''}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\">\n <IconButton type=\"submit\" size=\"small\" aria-label=\"search\">\n <MdiIcon path={mdiMagnify.path} fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n ),\n },\n }}\n />\n </form>\n )\n },\n)\nSearchBox.displayName = 'AglynSearchBox'\n\nexport const schema: Aglyn.ComponentSchema<SearchBoxProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Search Box',\n description:\n \"A search field that opens the site's search page. It works without JavaScript.\",\n category: Aglyn.ComponentCategory.FORMS,\n icon: { path: mdiMagnify.path, sx: { color: '#455a64' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'placeholder',\n description: 'Placeholder text inside the search field.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n label: 'Placeholder',\n },\n {\n name: 'defaultValue',\n description:\n 'Text the field starts with. The search results page fills in the ' +\n 'query it is showing.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n label: 'Starting text',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Search Box',\n pluginId: BUNDLE_ID,\n description: 'Search field that opens the site search page',\n category: Aglyn.ComponentCategory.FORMS,\n icon: { path: mdiMagnify.path, sx: { color: '#455a64' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n },\n]\n\nexport default SearchBox\n"],"names":["Aglyn","mdiMagnify","IconButton","InputAdornment","TextField","MdiIcon","useSoftGetSubmit","forwardRef","BUNDLE_ID","generatePresetId","ID","SearchBox","props","ref","placeholder","defaultValue","rest","onSubmit","form","action","method","role","name","size","slotProps","input","endAdornment","position","type","aria-label","path","fontSize","displayName","schema","$id","pluginId","description","category","ComponentCategory","FORMS","icon","sx","color","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","component","FieldComponentType","TEXT_FIELD","label","presets","NodeType","PRESET","data","componentId"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,UAAU,QAAQ,yBAAwB;AACnD,OAAOC,gBAAgB,2BAA0B;AACjD,OAAOC,oBAAoB,+BAA8B;AACzD,OAAOC,eAAe,0BAA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YACFY,WAAWhD,MAAMiD,kBAAkB,CAACC,UAAU;YAC9CC,OAAO;QACT;KACD;AACH,EAAC;AAED,OAAO,MAAMC,UAAgC;IAC3C;QACElB,KAAKzB,iBAAiBC;QACtBkB,MAAM5B,MAAMqD,QAAQ,CAACC,MAAM;QAC3BtB,aAAa;QACbG,UAAU3B;QACV4B,aAAa;QACbC,UAAUrC,MAAMsC,iBAAiB,CAACC,KAAK;QACvCC,MAAM;YAAEV,MAAM7B,WAAW6B,IAAI;YAAEW,IAAI;gBAAEC,OAAO;YAAU;QAAE;QACxDa,MAAM;YACJrB,KAAK;YACLsB,aAAa9C;YACbyB,UAAU3B;YACVI,OAAO,CAAC;QACV;IACF;CACD,CAAA;AAED,eAAeD,UAAS"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/mui/src/lib/components/search-box.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport { mdiMagnify } from '@aglyn/shared-data-mdi'\nimport Box from '@mui/material/Box'\nimport IconButton from '@mui/material/IconButton'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport TextField from '@mui/material/TextField'\nimport { MdiIcon } from '@aglyn/shared-ui-jsx'\nimport { useSoftGetSubmit } from '@aglyn/shared-ui-jsx/hooks/use-soft-get-submit'\nimport { forwardRef } from 'react'\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\n\n// Component ids are persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = 'searchBox'\n\nexport interface SearchBoxProps {\n placeholder?: string\n /**\n * What the field starts with (AGL-2513). The results page prefills the\n * query it is showing, so a reader can refine it where they are rather\n * than going back for the box they typed into.\n *\n * Uncontrolled on purpose: this component holds no state and issues no\n * request, and a `value` would freeze the field the moment the reader\n * typed into it.\n */\n defaultValue?: string\n}\n\n/**\n * Site search box (AGL-88): a plain GET form to the tenant's /search page,\n * so it works with zero JavaScript and is inert in the besigner (the\n * console has no /search route to submit to; navigation there is a no-op\n * form post the editor never triggers). Once hydrated the submit goes\n * through the client router, so the site's chrome stays mounted rather than\n * the whole document reloading for a results page.\n *\n * The form is an MUI Box so the element's style settings (`sx`, including a\n * per-breakpoint display or width) style it, as they do every other element\n * (AGL-3917).\n */\nconst SearchBox = forwardRef<HTMLFormElement, SearchBoxProps>(\n (props, ref) => {\n const { placeholder, defaultValue, ...rest } = props\n const onSubmit = useSoftGetSubmit()\n return (\n <Box\n component=\"form\"\n ref={ref}\n action=\"/search\"\n method=\"get\"\n role=\"search\"\n onSubmit={onSubmit}\n {...rest}\n >\n <TextField\n // Keyed by the starting text. A submit is a client navigation, so\n // this uncontrolled field can outlive the query it was mounted\n // with; a new key is what makes it re-read `defaultValue`.\n key={defaultValue || ''}\n name=\"q\"\n size=\"small\"\n placeholder={placeholder || 'Search…'}\n defaultValue={defaultValue || ''}\n slotProps={{\n input: {\n endAdornment: (\n <InputAdornment position=\"end\">\n <IconButton type=\"submit\" size=\"small\" aria-label=\"search\">\n <MdiIcon path={mdiMagnify.path} fontSize=\"small\" />\n </IconButton>\n </InputAdornment>\n ),\n },\n }}\n />\n </Box>\n )\n },\n)\nSearchBox.displayName = 'AglynSearchBox'\n\nexport const schema: Aglyn.ComponentSchema<SearchBoxProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Search Box',\n description:\n \"A search field that opens the site's search page. It works without JavaScript.\",\n category: Aglyn.ComponentCategory.FORMS,\n icon: { path: mdiMagnify.path, sx: { color: '#455a64' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'placeholder',\n description: 'Placeholder text inside the search field.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n label: 'Placeholder',\n },\n {\n name: 'defaultValue',\n description:\n 'Text the field starts with. The search results page fills in the ' +\n 'query it is showing.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n label: 'Starting text',\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Search Box',\n pluginId: BUNDLE_ID,\n description: 'Search field that opens the site search page',\n category: Aglyn.ComponentCategory.FORMS,\n icon: { path: mdiMagnify.path, sx: { color: '#455a64' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: {},\n },\n },\n]\n\nexport default SearchBox\n"],"names":["Aglyn","mdiMagnify","Box","IconButton","InputAdornment","TextField","MdiIcon","useSoftGetSubmit","forwardRef","BUNDLE_ID","generatePresetId","ID","SearchBox","props","ref","placeholder","defaultValue","rest","onSubmit","component","action","method","role","name","size","slotProps","input","endAdornment","position","type","aria-label","path","fontSize","displayName","schema","$id","pluginId","description","category","ComponentCategory","FORMS","icon","sx","color","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","FieldComponentType","TEXT_FIELD","label","presets","NodeType","PRESET","data","componentId"],"mappings":";;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SAASC,UAAU,QAAQ,yBAAwB;AACnD,OAAOC,SAAS,oBAAmB;AACnC,OAAOC,gBAAgB,2BAA0B;AACjD,OAAOC,oBAAoB,+BAA8B;AACzD,OAAOC,eAAe,0BAAyB;AAC/C,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SAASC,gBAAgB,QAAQ,iDAAgD;AACjF,SAASC,UAAU,QAAQ,QAAO;AAClC,SAASC,SAAS,QAAQ,gCAA4B;AACtD,SAASC,gBAAgB,QAAQ,iCAA6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