Commit graph

234 commits

Author SHA1 Message Date
Max
413fd71841 feat(middleware): add support for markdown content negotiation and rendering
- Implemented content negotiation for markdown files based on URL suffix and Accept header.
- Introduced a new RenderRaw method to serve raw markdown content, bypassing HTML rendering.
- Updated PageConfig to include a handler for markdown output, enhancing flexibility in content delivery.
2026-04-02 18:55:36 +08:00
Max
c7cdfbdfe6 Refactor error handling in middleware and clean up template struct comments
- Adjust error handling in the middleware to ensure proper redirection for HTTP status codes 301 and 302.
- Clean up comments in the Template struct for better readability and consistency.
2026-02-15 17:56:54 +08:00
Max
621290d578 Enhance guard handling and template configuration merging
- Update the OAuth guard to prevent automatic response writing on failure, allowing for custom error handling.
- Introduce a mechanism to register default guard redirects from template configurations, improving guard management.
- Refactor the page configuration merging process to prioritize page-specific settings while allowing inheritance from templates.
- Ensure guards can be explicitly disabled in page configurations, enhancing flexibility in guard application.
2026-02-15 16:34:31 +08:00
Max
19c2d6b547 Implement dynamic route resolution using rewrite rules
- Introduce a new `RewriteRule` type and associated functions for managing URL rewrite rules in `service/static.go`.
- Add `GetRewriteRules` and `ResolveRoute` functions to facilitate the retrieval and application of rewrite rules.
- Update the `sui/api/run.go` to utilize the new route resolver for handling dynamic routes when the config file is not found.
- Define `RouteResolver` in `sui/core/interfaces.go` to allow for dynamic route resolution across the application.
2026-02-13 23:44:28 +08:00
Max
d598394337 Update asset metadata timestamps and enhance translation handling
- Update timestamps in `bindata.go` for various asset files to reflect recent modifications.
- Modify translation handling in `parser.go` to merge messages from YAML locale files with script messages, ensuring all translation keys are available at runtime.
- Refactor `writeLocaleFiles` in `page.go` to accept a build context, allowing for better integration of script translations during the build process.
2026-02-12 19:06:56 +08:00
Max
bdcc3585e2 Enhance script resolution logic and update asset metadata
- Refactor the `ResolveScript` function to improve the script path resolution strategy, allowing for better handling of assistant directories and module paths.
- Update asset metadata timestamps in `bindata.go` to reflect recent changes, ensuring accurate tracking of file modifications.
- Modify CSS component name formatting in `build.go` and TypeScript component selectors in `index.ts` for consistency in syntax.
- Improve locale handling in `locale.go` by implementing a fallback mechanism for locale file resolution based on language prefixes.
- Normalize locale values in `request.go` to lowercase for consistency across the application.
- Enhance component name sanitization in `utils.go` to replace additional characters, ensuring valid component naming conventions.
2026-02-09 18:32:24 +08:00
Max
787954f0af Enhance OpenAPI Integration and API Routing
- Introduced support for OpenAPI mode, allowing dynamic routing and OAuth guards for API endpoints.
- Updated API root path handling to accommodate OpenAPI configurations, ensuring consistent URL structures.
- Added well-known routes for Yao metadata and OAuth discovery, improving API discoverability.
- Refactored middleware and guards to streamline OpenAPI integration, enhancing overall service functionality.
- Removed deprecated agent TypeScript file, simplifying the codebase and improving maintainability.
2026-01-04 15:46:09 +08:00
Max
0825e06dbe Implement Multi-Directory Watching and Enhance Locale File Handling
- Introduced the IWatchDirs interface to support watching multiple directories for changes, allowing templates to specify directories dynamically.
- Updated the watch command to handle multiple directories and display watched directories in the output.
- Added functionality to write locale files from a page's __locales directory to the public directory, improving localization support.
- Enhanced error handling during directory watching and locale file processing for better reliability and logging.
2026-01-03 14:39:57 +08:00
Max
097fb73416 Refactor SUI Command Arguments and Enhance Default Template Handling
- Updated the `build` and `watch` commands to accept a single argument for `<sui>` and made the `<template>` argument optional, improving usability.
- Introduced a default template assignment for the `agent` SUI, ensuring a more intuitive setup for users.
- Enhanced error messages for command usage to provide clearer guidance on expected input format.
- Added new OpenAPI file to the bindata, improving the framework's capabilities for API integration.
2026-01-01 10:28:45 +08:00
Max
595709f834 # Enhanced Yao AI Agent SDK
Improved the Yao AI Agent SDK with better type definitions and error handling.

## Key Updates
- Added typed interfaces for attachments and messages
- Optimized attachment handling (only send when present)
- Enhanced error handling with specific error messages
- Improved event system for message streaming
- Added comprehensive TypeScript definitions
2025-05-05 12:48:58 +08:00
Max
77efc03582 feat: Enhance global build context and component handling
- Update NewGlobalBuildContext to accept a template parameter for improved context management.
- Refactor component handling in Compile method to include JIT components, enhancing dynamic component loading.
- Modify TemplateRender to utilize the updated global context, improving template processing.
- Adjust component attribute parsing to use "s:route" for better clarity in component identification.
2025-04-23 16:08:10 +08:00
Max
8371a8959f chore: Update go-colorable dependency to v0.1.14 and refactor expression execution
- Bump github.com/mattn/go-colorable from v0.1.13 to v0.1.14 in go.mod and go.sum.
- Refactor expression execution in pipe and core data handling to use a map for improved type safety.
2025-03-28 23:37:13 +08:00
Max
e59dacefa2 Improve error handling in request value execution
- Modify request value execution to log errors when method calls fail
- Prevent propagation of errors during value resolution
- Update error message in data merging to be more descriptive
2025-03-06 10:48:27 +08:00
Max
68a97a48e6 Update URL handling in request data to use mapped URL 2024-12-03 16:21:52 +08:00
Max
35911de0ea Enhance SEO metadata handling by adding keywords support and fixing og:title attribute syntax 2024-11-29 11:12:37 +08:00
Max
574c2aad82 fix sui dynamic components render bug 2024-09-30 18:42:42 +08:00
Max
371490360e fix misspelling 2024-09-30 17:07:29 +08:00
Max
369d6cc4d8 fix sui dynamic components import bug 2024-09-30 17:02:24 +08:00
Max
896e52a52a Fix PublicRoot bug and get Sid from request 2024-09-25 08:25:37 +08:00
Max
67ad169bf5 Refactor dynamic component parsing in SUI core 2024-09-11 09:24:34 +08:00
Max
fb6518e91f Fix the bug in real-time rendering mode 2024-09-10 16:29:15 +08:00
Max
07353d0084 Add s:route attribute to real time render components 2024-09-03 17:40:31 +08:00
Max
d00b62caf1 Refactor event binding in SUI core to support just-in-time mode 2024-09-02 18:28:16 +08:00
Max
db033a10fd [add] SUI real-time rendering mode supports event binding (page event only) 2024-09-02 17:04:22 +08:00
Max
a3d2baef40 Refactor component attribute handling to support spread operator 2024-08-30 10:42:25 +08:00
Max
219f71b00e chore: Refactor TemplateRender to handle optional request parameters 2024-08-23 12:20:33 +08:00
Max
0f6bc06172 fix render public root bug 2024-08-10 17:18:35 +08:00
Max
80779bb0fc [feat] add SUI template.render process 2024-08-10 16:58:38 +08:00
Max
f531b32634 Improve SUI Component element manipulation methods and add queryAll method 2024-08-08 18:57:47 +08:00
Max
38884a7b0c Improve SUI Component element manipulation methods and add queryAll method 2024-08-07 17:42:16 +08:00
Max
252e1793ac chore: Add empty expression helper and improve SUI Component element manipulation methods 2024-08-07 11:11:11 +08:00
Max
f6ae0cef47 [add] Empty expression helper 2024-08-07 11:08:25 +08:00
Max
c5cf0babf9 Refactor component initialization script to include injected code 2024-08-07 11:02:43 +08:00
Max
f44021d582 chore: improve SUI Component element manipulation methods 2024-08-06 20:10:48 +08:00
Max
d61ebadf43 chore: improve SUI Component element manipulation methods 2024-08-06 18:49:21 +08:00
Max
ad7954dbb2 chore: Update cacheStore field name in PageSetting struct 2024-08-06 14:48:12 +08:00
Max
2a19ef857b chore: Update __Query class to accept both string and Element types for selector 2024-08-06 09:31:36 +08:00
Max
9977b62a09 [feat] SUI $backend function call supports custom Guard 2024-08-05 08:32:59 +08:00
Max
d170ab6e53 Optimize $backend function call 2024-08-04 11:40:15 +08:00
Max
6f1f558ecd feat: Add source map URL to libsui.min.js for better debugging 2024-08-03 17:08:38 +08:00
Max
a2e5a52ad8 feat: Update event handling in sui/core to support event component names 2024-08-03 11:23:59 +08:00
Max
5514fea7ec feat: Add yao.ts to libsui for Pure JavaScript SDK 2024-08-03 08:52:05 +08:00
Max
5f5af44018 Optimize libsui js-sdk loading logic 2024-08-03 08:37:54 +08:00
Max
a07c1ece51 Add s:render feature for data update rendering (dev) 2024-08-02 21:18:02 +08:00
Max
743339d3d4 feat: Add Store function to utils in injections.go 2024-08-02 19:05:35 +08:00
Max
83e1081c9b feat: Update script loading to handle source root mapping from tsconfig.json 2024-08-01 19:11:27 +08:00
Max
44eb60377d Update file extensions for backend scripts 2024-08-01 18:43:15 +08:00
Max
fc1f80e0f5 feat: Add sourceRoots to Static struct in types.go 2024-08-01 18:16:59 +08:00
Max
db397f8cda feat: add state propagation mechanism support to sui components 2024-07-30 10:52:13 +08:00
Max
0870332e8b Add $utils object in libsui for enhanced utility functions 2024-07-30 09:33:43 +08:00