mtxuilib 0.0.349 → 0.0.351
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/dist/esm/lib/trpc/MutationCallButton.d.ts +13 -0
- package/dist/esm/lib/trpc/MutationCallButton.js +1 -0
- package/dist/esm/ui/ui-mt/DropdownMenuItemLink.d.ts +7 -0
- package/dist/esm/ui/ui-mt/DropdownMenuItemLink.js +1 -0
- package/dist/esm/ui/ui-mt/input-field/RichEditorInput.js +1 -1
- package/dist/lib/trpc/MutationCallButton.cjs +57 -0
- package/dist/tsconfig.type.tsbuildinfo +1 -1
- package/dist/ui/ui-mt/DropdownMenuItemLink.cjs +49 -0
- package/dist/ui/ui-mt/input-field/RichEditorInput.cjs +15 -4
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DecoratedMutation } from "@trpc/react-query/dist/createTRPCReact";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
3
|
+
type ResolverDef = {
|
|
4
|
+
input: any;
|
|
5
|
+
output: any;
|
|
6
|
+
transformer: boolean;
|
|
7
|
+
errorShape: any;
|
|
8
|
+
};
|
|
9
|
+
export declare function MutationCallButton<T extends ResolverDef>(props: {
|
|
10
|
+
method: DecoratedMutation<T>;
|
|
11
|
+
variables?: any;
|
|
12
|
+
} & PropsWithChildren): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var s=(e,n,o)=>new Promise((r,u)=>{var p=t=>{try{a(o.next(t))}catch(i){u(i)}},c=t=>{try{a(o.throw(t))}catch(i){u(i)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(p,c);a((o=o.apply(e,n)).next())});import{Fragment as d,jsx as l}from"react/jsx-runtime";import{MtButton as m}from"../../ui/ui-mt/Button";function v(e){const{method:n,children:o}=e,r=n.useMutation();return l(d,{children:l(m,{onClick:()=>s(this,null,function*(){yield r.mutateAsync({})}),children:o})})}export{v as MutationCallButton};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { DropdownMenuItem } from "../dropdown-menu";
|
|
3
|
+
type DropdownMenuItemLinkProps = ComponentProps<typeof DropdownMenuItem>;
|
|
4
|
+
export declare const DropdownMenuItemLink: (props: {
|
|
5
|
+
href: string;
|
|
6
|
+
} & DropdownMenuItemLinkProps) => import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var t=Object.getOwnPropertySymbols;var i=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var p=(n,e)=>{var r={};for(var o in n)i.call(n,o)&&e.indexOf(o)<0&&(r[o]=n[o]);if(n!=null&&t)for(var o of t(n))e.indexOf(o)<0&&M.call(n,o)&&(r[o]=n[o]);return r};import{jsx as m}from"react/jsx-runtime";import{MtLink as d}from"../../common/mtlink";import{DropdownMenuItem as f}from"../dropdown-menu";const k=n=>{const o=n,{href:e}=o,r=p(o,["href"]);return m(d,{href:e,children:m(f,{children:"Edit"})})};export{k as DropdownMenuItemLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{useMemo as s}from"react";import{useFormContext as m}from"react-hook-form";import{TailwindAdvancedEditor as c}from"../../novel/tailwind/advanced-editor";import{convertEditorJsonToHTML as p}from"../../novel/tailwind/utils";const h=o=>{const{name:e}=o,t=m(),r=s(()=>t.getValues()[e],[t,e]);return n("div",{children:n(c,{content:r,onValueChange:i=>{const a=p(i);t.setValue("content",a)}})})};export{h as RichTextInput};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var __async = (__this, __arguments, generator) => {
|
|
21
|
+
return new Promise((resolve, reject) => {
|
|
22
|
+
var fulfilled = (value) => {
|
|
23
|
+
try {
|
|
24
|
+
step(generator.next(value));
|
|
25
|
+
} catch (e) {
|
|
26
|
+
reject(e);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var rejected = (value) => {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.throw(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var MutationCallButton_exports = {};
|
|
41
|
+
__export(MutationCallButton_exports, {
|
|
42
|
+
MutationCallButton: () => MutationCallButton
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(MutationCallButton_exports);
|
|
45
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
46
|
+
var import_Button = require("../../ui/ui-mt/Button");
|
|
47
|
+
function MutationCallButton(props) {
|
|
48
|
+
const { method, children } = props;
|
|
49
|
+
const a = method.useMutation();
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.MtButton, { onClick: () => __async(this, null, function* () {
|
|
51
|
+
yield a.mutateAsync({});
|
|
52
|
+
}), children }) });
|
|
53
|
+
}
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
MutationCallButton
|
|
57
|
+
});
|